projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44dd941
)
instance: Fix instance_config_move_strdup() function
author
Daniel Golle
<daniel@makrotopia.org>
Sun, 19 Jan 2020 07:42:37 +0000
(09:42 +0200)
committer
Daniel Golle
<daniel@makrotopia.org>
Sun, 19 Jan 2020 07:43:58 +0000
(09:43 +0200)
instance_config_move_strdup() previously returned too early in case of
a value being previously unassigned.
Fixes:
153820c
("instance: fix pidfile and seccomp attributes double free")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
service/instance.c
patch
|
blob
|
history
diff --git
a/service/instance.c
b/service/instance.c
index ee258687c3cf8f1202a01d848c88217b2a793fdb..14da86247c7087f476bcfa6435c81fa006c24eee 100644
(file)
--- a/
service/instance.c
+++ b/
service/instance.c
@@
-1021,11
+1021,10
@@
instance_config_cleanup(struct service_instance *in)
static void
instance_config_move_strdup(char **dst, char *src)
{
- if (!*dst)
- return;
-
- free(*dst);
- *dst = NULL;
+ if (*dst) {
+ free(*dst);
+ *dst = NULL;
+ }
if (!src)
return;