diff options
author | Tim Potter <tpot@samba.org> | 2008-02-18 21:00:51 +1100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-02-20 18:27:40 -0800 |
commit | 441de75e58daf734c412a3e741608822289cac59 (patch) | |
tree | 8406a1757ffb139d2125ddaf37418586454864a3 | |
parent | abf84656593c567e42025eaf6b1961a2294f913b (diff) | |
download | samba-441de75e58daf734c412a3e741608822289cac59.tar.gz samba-441de75e58daf734c412a3e741608822289cac59.tar.bz2 samba-441de75e58daf734c412a3e741608822289cac59.zip |
Fix memory leaks on error path
(This used to be commit 47dd0700b4320bf5ac9a80e71ae82d82d4554e6a)
-rw-r--r-- | source3/libsmb/clifile.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 9b4c380d40..10c35a30cc 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -38,8 +38,15 @@ static bool cli_link_internal(struct cli_state *cli, const char *oldname, const size_t newlen = 2*(strlen(newname)+1); param = SMB_MALLOC_ARRAY(char, 6+newlen+2); + + if (!param) { + return false; + } + data = SMB_MALLOC_ARRAY(char, oldlen+2); - if (!param || !data) { + + if (!data) { + SAFE_FREE(param); return false; } |