git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abf8465
)
Fix memory leaks on error path
author
Tim Potter
<tpot@samba.org>
Mon, 18 Feb 2008 10:00:51 +0000
(21:00 +1100)
committer
Jeremy Allison
<jra@samba.org>
Thu, 21 Feb 2008 02:27:40 +0000
(18:27 -0800)
(This used to be commit
47dd0700b4320bf5ac9a80e71ae82d82d4554e6a
)
source3/libsmb/clifile.c
patch
|
blob
|
history
diff --git
a/source3/libsmb/clifile.c
b/source3/libsmb/clifile.c
index 9b4c380d40705e74afddca0279ffbc4b00e08e05..10c35a30cc84c990ed6044c0065e0f907c7cfee2 100644
(file)
--- 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;
}