From 2e783a47076bd0994b6ce86df7ec967bc1c2da63 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 12 Aug 2001 17:30:01 +0000 Subject: this is a big global fix for the ptr = Realloc(ptr, size) bug. many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9) --- source3/smbwrapper/smbw_dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/smbwrapper/smbw_dir.c') diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c index 4f6c18eb7f..d9dae454bb 100644 --- a/source3/smbwrapper/smbw_dir.c +++ b/source3/smbwrapper/smbw_dir.c @@ -80,16 +80,19 @@ add a entry to a directory listing static void smbw_dir_add(struct file_info *finfo, const char *mask, void *state) { + struct file_info *cdl; + DEBUG(5,("%s\n", finfo->name)); if (cur_dir->malloced == cur_dir->count) { - cur_dir->list = (struct file_info *)Realloc(cur_dir->list, + cdl = (struct file_info *)Realloc(cur_dir->list, sizeof(cur_dir->list[0])* (cur_dir->count+100)); if (!cur_dir->list) { /* oops */ return; } + cur_dir->list = cdl; cur_dir->malloced += 100; } -- cgit