git.samba.org
/
metze
/
heimdal
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8fc6765
)
roken: fix theoretical leak introduced in 7fbe7be6
author
Luke Howard
<lukeh@padl.com>
Thu, 23 Sep 2021 00:32:45 +0000
(10:32 +1000)
committer
Luke Howard
<lukeh@padl.com>
Thu, 23 Sep 2021 00:32:45 +0000
(10:32 +1000)
split_spec() should free output parameters if it fails. This was not a leak in
practice because its single caller cleaned up anyway, but cleaning up for good
hygiene.
lib/roken/roken_gethostby.c
patch
|
blob
|
history
diff --git
a/lib/roken/roken_gethostby.c
b/lib/roken/roken_gethostby.c
index f7b5086c400f4220a21b54797b4621b37241d03f..a2febd0d169054095b5d42aa2867fdc7b654803a 100644
(file)
--- a/
lib/roken/roken_gethostby.c
+++ b/
lib/roken/roken_gethostby.c
@@
-102,8
+102,11
@@
split_spec(const char *spec, char **host, int *port, char **path, int def_port)
if(p) {
if(path) {
*path = strdup(p);
- if (*path == NULL)
+ if (*path == NULL) {
+ free(*host);
+ *host = NULL;
return -1;
+ }
}
*p = '\0';
}else