From: fredrik Date: Thu, 26 Oct 2006 00:15:40 +0000 (+0000) Subject: Fix memory leak. X-Git-Tag: 0.3~208 X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=commitdiff_plain;h=2dd01e6ee102502c267d582a7037014bbd5d36f7 Fix memory leak. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@715 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/daemon/fnet-dc.c b/daemon/fnet-dc.c index 772306c..198672f 100644 --- 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((buf = base32decode(p + 4, &buflen)) == NULL) - goto out; - if(buflen != 24) + if(((buf = base32decode(p + 4, &buflen)) == NULL) || (buflen != 24)) + { + free(buf); goto out; + } memcpy(hashtth, buf, 24); free(buf); } else {