[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Mar 30 21:20:02 MDT 2011


The branch, master has been updated
       via  7cd5a79 Arg. I hate the "if (xxx) return foo" all on one line style of code.
      from  21193c8 Don't burn 2k of stack on every iconv, use the heap when it's a slow call.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7cd5a79cd45fdc10d73ff32d81c4d86c5613f347
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Mar 30 19:27:29 2011 -0700

    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 at samba.org>
    Autobuild-Date: Thu Mar 31 05:19:34 CEST 2011 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 lib/util/charset/iconv.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index 24434ec..74b931f 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);
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list