From: shdown Date: Mon, 3 Aug 2015 09:51:55 +0000 (+0300) Subject: Use safe wrappers inside "#if 0" too X-Git-Tag: 4.11~58^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F1789%2Fhead;p=i3%2Fi3 Use safe wrappers inside "#if 0" too --- 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); }