core: fix a potential mem leak

Found with Coverity. Fixes: CID#996438
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2014-09-13 12:35:06 +02:00
parent 0ee9613d98
commit 4d5e13a125
1 changed files with 4 additions and 1 deletions

View File

@ -1367,8 +1367,11 @@ int config_parse_timer(const char *unit,
}
v = new0(TimerValue, 1);
if (!v)
if (!v) {
if (c)
free(c);
return log_oom();
}
v->base = b;
v->value = u;