Merge across tridge's Realloc fix.
authorJeremy Allison <jra@samba.org>
Mon, 14 Apr 2003 11:04:57 +0000 (11:04 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 14 Apr 2003 11:04:57 +0000 (11:04 +0000)
Jeremy.
(This used to be commit df214d18817467fbe3023a412bceec325f73b518)

source3/lib/charcnv.c

index 00670f4a852868632d33c2b54fbcb7e3a31a347c..8b93e30267048b75cb72fcccb634b1944ff76f53 100644 (file)
@@ -220,14 +220,14 @@ size_t convert_string_allocate(charset_t from, charset_t to,
        outbuf = NULL;
 convert:
        destlen = destlen * 2;
-       ob = (char *)realloc(outbuf, destlen);
+       ob = (char *)Realloc(outbuf, destlen);
        if (!ob) {
                DEBUG(0, ("convert_string_allocate: realloc failed!\n"));
                SAFE_FREE(outbuf);
                return (size_t)-1;
-       }
-       else
+       } else {
                outbuf = ob;
+       }
        i_len = srclen;
        o_len = destlen;
        retval = smb_iconv(descriptor,