summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-04-06 12:28:00 +0000
committerAndrew Tridgell <tridge@samba.org>2003-04-06 12:28:00 +0000
commit06ee9702a00d69d4fc19925977f9741e9ffd2822 (patch)
tree281c98d5c1141d89327038e5e75767d1e0379ce7 /source3
parent854c5d60bd89d5d6a8b4b44c8297e16a425ffb2d (diff)
downloadsamba-06ee9702a00d69d4fc19925977f9741e9ffd2822.tar.gz
samba-06ee9702a00d69d4fc19925977f9741e9ffd2822.tar.bz2
samba-06ee9702a00d69d4fc19925977f9741e9ffd2822.zip
don't rely on realloc() working on NULL
(This used to be commit bd00355c1d5ca4ce77fa28c53ea46834365f22d7)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/charcnv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 42cba33483..ad39a6e5dc 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -214,14 +214,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,