chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d1d7cae
)
path-util: set pointer to null after calling free()
author
Michal Sekletar
<msekleta@redhat.com>
Thu, 13 Dec 2012 13:59:39 +0000
(14:59 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 17 Dec 2012 10:41:31 +0000
(11:41 +0100)
In cases where path_strv_canonicalize() returns NULL, strv_free() is
called afterwards and it will call free() on pointers which were freed
already in path_strv_canonicalize()
src/shared/path-util.c
patch
|
blob
|
history
diff --git
a/src/shared/path-util.c
b/src/shared/path-util.c
index 70c8a8af06f9b2ea9db57784db96a405dc272e88..dd12d3d63409654fb446028ba92a0860bc83e4c1 100644
(file)
--- a/
src/shared/path-util.c
+++ b/
src/shared/path-util.c
@@
-181,6
+181,7
@@
char **path_strv_canonicalize(char **l) {
t = path_make_absolute_cwd(*s);
free(*s);
+ *s = NULL;
if (!t) {
enomem = true;