summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2008-02-18 21:00:51 +1100
committerJeremy Allison <jra@samba.org>2008-02-20 18:27:40 -0800
commit441de75e58daf734c412a3e741608822289cac59 (patch)
tree8406a1757ffb139d2125ddaf37418586454864a3
parentabf84656593c567e42025eaf6b1961a2294f913b (diff)
downloadsamba-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.c9
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;
}