summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-08-23 13:23:49 +0000
committerTim Potter <tpot@samba.org>2002-08-23 13:23:49 +0000
commit53fabdee019699d39648fadafa0963ecb04ba3aa (patch)
treefc57b46abe39af8639892e730c250834f5c8e854
parentd58445d6cc6921fd8fa2049b0c50d32b6d961c1d (diff)
downloadsamba-53fabdee019699d39648fadafa0963ecb04ba3aa.tar.gz
samba-53fabdee019699d39648fadafa0963ecb04ba3aa.tar.bz2
samba-53fabdee019699d39648fadafa0963ecb04ba3aa.zip
Don't take the sizeof(struct in_addr) * -1
(This used to be commit e13016bb42dbba675d6e7ee7e163543aad2e62c2)
-rw-r--r--source3/libsmb/namecache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c
index f05f76a22b..d985832613 100644
--- a/source3/libsmb/namecache.c
+++ b/source3/libsmb/namecache.c
@@ -93,8 +93,10 @@ static TDB_DATA namecache_value(struct in_addr *ip_list, int num_names,
struct nc_value *value;
int size;
- size = sizeof(struct nc_value) + sizeof(struct in_addr) *
- (num_names-1);
+ size = sizeof(struct nc_value);
+
+ if (num_names > 0)
+ size += sizeof(struct in_addr) * (num_names-1);
value = (struct nc_value *)malloc(size);