summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-08-08 16:54:16 +0000
committerSimo Sorce <idra@samba.org>2001-08-08 16:54:16 +0000
commit2f844bf447a98b802daa4b8d552ea4530e7f6108 (patch)
tree7beda0672e5fcc15125a7643d4d5fdef6f02b49e /source3/lib
parent0897979a8b0976e03a84ccaf6a70cbaa62bbd195 (diff)
downloadsamba-2f844bf447a98b802daa4b8d552ea4530e7f6108.tar.gz
samba-2f844bf447a98b802daa4b8d552ea4530e7f6108.tar.bz2
samba-2f844bf447a98b802daa4b8d552ea4530e7f6108.zip
Change all realloc() statements to Realloc() (ecxept for tdb.c)
changed some code to exploit the fact that Realloc(NULL, size) == malloc(size) fixed some possible mem leaks, or seg faults. thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c) (This used to be commit 7f33c01688b825ab2fa9bbb2730bff4f2fa352be)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/sysacls.c2
-rw-r--r--source3/lib/talloc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index b1347b80e9..98f0617d44 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -689,7 +689,7 @@ char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p)
maxlen += nbytes + 20 * (acl_d->count - i);
- if ((text = realloc(oldtext, maxlen)) == NULL) {
+ if ((text = Realloc(oldtext, maxlen)) == NULL) {
free(oldtext);
errno = ENOMEM;
return NULL;
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index a8ee481744..cfd130e888 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -90,7 +90,7 @@ void *talloc_realloc(TALLOC_CTX *t, void *ptr, size_t size)
for (tc=t->list; tc; tc=tc->next) {
if (tc->ptr == ptr) {
- ptr = realloc(ptr, size);
+ ptr = Realloc(ptr, size);
if (ptr) {
t->total_alloc_size += (size - tc->size);
tc->size = size;