summaryrefslogtreecommitdiff
path: root/lib/util/charset
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-03-30 19:27:29 -0700
committerJeremy Allison <jra@samba.org>2011-03-31 05:19:33 +0200
commit7cd5a79cd45fdc10d73ff32d81c4d86c5613f347 (patch)
tree13150a41b2091afeff6b8beca0d55bc46f4e8c33 /lib/util/charset
parent21193c8eeba6d03f680ad34acbbb4cff14d87809 (diff)
downloadsamba-7cd5a79cd45fdc10d73ff32d81c4d86c5613f347.tar.gz
samba-7cd5a79cd45fdc10d73ff32d81c4d86c5613f347.tar.bz2
samba-7cd5a79cd45fdc10d73ff32d81c4d86c5613f347.zip
Arg. I hate the "if (xxx) return foo" all on one line style of code.
Fix the talloc leaks I introduced by not spotting these returns. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Mar 31 05:19:34 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util/charset')
-rw-r--r--lib/util/charset/iconv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index 24434ec809..74b931fa12 100644
--- a/lib/util/charset/iconv.c
+++ b/lib/util/charset/iconv.c
@@ -190,13 +190,19 @@ _PUBLIC_ size_t smb_iconv(smb_iconv_t cd,
if (cd->pull(cd->cd_pull,
inbuf, inbytesleft, &bufp1, &bufsize) == -1
- && errno != E2BIG) return -1;
+ && errno != E2BIG) {
+ talloc_free(cvtbuf);
+ return -1;
+ }
bufsize = SMB_ICONV_BUFSIZE - bufsize;
if (cd->push(cd->cd_push,
&bufp2, &bufsize,
- outbuf, outbytesleft) == -1) return -1;
+ outbuf, outbytesleft) == -1) {
+ talloc_free(cvtbuf);
+ return -1;
+ }
}
talloc_free(cvtbuf);
}