summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-10-14 09:25:19 +0000
committerAndrew Tridgell <tridge@samba.org>2001-10-14 09:25:19 +0000
commit0567d2d969af381fc691a5e3b02ed4a0af2383de (patch)
tree3c3e338443c1dbac13e8faaa0ef9b5034be8a01c /source3/libsmb
parentf2d595e262a5140c04d26b68818e005532c0b3c1 (diff)
downloadsamba-0567d2d969af381fc691a5e3b02ed4a0af2383de.tar.gz
samba-0567d2d969af381fc691a5e3b02ed4a0af2383de.tar.bz2
samba-0567d2d969af381fc691a5e3b02ed4a0af2383de.zip
minor Realloc() fix - pedantic
(This used to be commit 1bcdf9106afacbe18437e87178bc1f219695c1e9)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/asn1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c
index 6a92a6be00..e72da897b9 100644
--- a/source3/libsmb/asn1.c
+++ b/source3/libsmb/asn1.c
@@ -32,11 +32,14 @@ BOOL asn1_write(ASN1_DATA *data, const void *p, int len)
{
if (data->has_error) return False;
if (data->length < data->ofs+len) {
- data->data = Realloc(data->data, data->ofs+len);
- if (!data->data) {
+ uint8 *p;
+ p = Realloc(data->data, data->ofs+len);
+ if (!p) {
+ SAFE_FREE(data->data);
data->has_error = True;
return False;
}
+ data->data = p;
data->length = data->ofs+len;
}
memcpy(data->data + data->ofs, p, len);