From ad9ecd52faa4c911f0726a56fd13411fc9978890 Mon Sep 17 00:00:00 2001 From: shdown Date: Mon, 3 Aug 2015 12:51:55 +0300 Subject: [PATCH] Use safe wrappers inside "#if 0" too --- src/commands_parser.c | 6 +++--- src/config_parser.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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); } -- 2.39.5