diff --git a/src/commands_parser.c b/src/commands_parser.c index a4602d15..ffe416f0 100644 --- a/src/commands_parser.c +++ b/src/commands_parser.c @@ -148,9 +148,9 @@ static TAILQ_HEAD(criteria_head, criterion) criteria = */ static void push_criterion(void *unused_criteria, const char *type, const char *value) { - struct criterion *criterion = malloc(sizeof(struct criterion)); - criterion->type = strdup(type); - criterion->value = strdup(value); + struct criterion *criterion = smalloc(sizeof(struct criterion)); + criterion->type = sstrdup(type); + criterion->value = sstrdup(value); TAILQ_INSERT_TAIL(&criteria, criterion, criteria); } diff --git a/src/config_parser.c b/src/config_parser.c index e563c808..6393efe9 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -202,9 +202,9 @@ static TAILQ_HEAD(criteria_head, criterion) criteria = */ static void push_criterion(void *unused_criteria, const char *type, const char *value) { - struct criterion *criterion = malloc(sizeof(struct criterion)); - criterion->type = strdup(type); - criterion->value = strdup(value); + struct criterion *criterion = smalloc(sizeof(struct criterion)); + criterion->type = sstrdup(type); + criterion->value = sstrdup(value); TAILQ_INSERT_TAIL(&criteria, criterion, criteria); }