Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leak.
[doldaconnect.git]
/
daemon
/
fnet-dc.c
diff --git
a/daemon/fnet-dc.c
b/daemon/fnet-dc.c
index
772306c
..
198672f
100644
(file)
--- a/
daemon/fnet-dc.c
+++ b/
daemon/fnet-dc.c
@@
-1167,10
+1167,11
@@
static void cmd_search(struct socket *sk, struct fnetnode *fn, char *cmd, char *
if(!dotth && !strncmp(p, "TTH:", 4))
{
dotth = 1;
if(!dotth && !strncmp(p, "TTH:", 4))
{
dotth = 1;
- if((
buf = base32decode(p + 4, &buflen)) == NULL
)
- goto out;
- if(buflen != 24)
+ if((
(buf = base32decode(p + 4, &buflen)) == NULL) || (buflen != 24)
)
+ {
+ free(buf);
goto out;
goto out;
+ }
memcpy(hashtth, buf, 24);
free(buf);
} else {
memcpy(hashtth, buf, 24);
free(buf);
} else {