forked from pool/systemd
26 lines
745 B
Diff
26 lines
745 B
Diff
|
Based on 4d5e13a125cf8d77d432225ab69826caa1d1cf59 Mon Sep 17 00:00:00 2001
|
||
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
||
|
Date: Sat, 13 Sep 2014 12:35:06 +0200
|
||
|
Subject: [PATCH] core: fix a potential mem leak
|
||
|
|
||
|
Found with Coverity. Fixes: CID#996438
|
||
|
---
|
||
|
src/core/load-fragment.c | 5 ++++-
|
||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||
|
|
||
|
--- src/core/load-fragment.c
|
||
|
+++ src/core/load-fragment.c 2014-09-16 10:35:13.354235607 +0000
|
||
|
@@ -1294,8 +1294,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->clock_id = id;
|