Use safe wrappers inside "#if 0" too

This commit is contained in:
shdown 2015-08-03 12:51:55 +03:00
parent 7ef3fdec00
commit ad9ecd52fa
2 changed files with 6 additions and 6 deletions

View File

@ -148,9 +148,9 @@ static TAILQ_HEAD(criteria_head, criterion) criteria =
*/ */
static void push_criterion(void *unused_criteria, const char *type, static void push_criterion(void *unused_criteria, const char *type,
const char *value) { const char *value) {
struct criterion *criterion = malloc(sizeof(struct criterion)); struct criterion *criterion = smalloc(sizeof(struct criterion));
criterion->type = strdup(type); criterion->type = sstrdup(type);
criterion->value = strdup(value); criterion->value = sstrdup(value);
TAILQ_INSERT_TAIL(&criteria, criterion, criteria); TAILQ_INSERT_TAIL(&criteria, criterion, criteria);
} }

View File

@ -202,9 +202,9 @@ static TAILQ_HEAD(criteria_head, criterion) criteria =
*/ */
static void push_criterion(void *unused_criteria, const char *type, static void push_criterion(void *unused_criteria, const char *type,
const char *value) { const char *value) {
struct criterion *criterion = malloc(sizeof(struct criterion)); struct criterion *criterion = smalloc(sizeof(struct criterion));
criterion->type = strdup(type); criterion->type = sstrdup(type);
criterion->value = strdup(value); criterion->value = sstrdup(value);
TAILQ_INSERT_TAIL(&criteria, criterion, criteria); TAILQ_INSERT_TAIL(&criteria, criterion, criteria);
} }