Don't try to allocate zero bytes in push_local_excludes().
authorWayne Davison <wayned@samba.org>
Tue, 25 Jan 2005 02:30:59 +0000 (02:30 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 25 Jan 2005 02:30:59 +0000 (02:30 +0000)
exclude.c

index a0a9472..10f246e 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -388,6 +388,9 @@ void *push_local_excludes(const char *dir, unsigned int dirlen)
 
        set_excludes_dir(dir, dirlen);
 
+       if (!mergelist_cnt)
+               return NULL;
+
        push = new_array(struct exclude_list_struct, mergelist_cnt);
        if (!push)
                out_of_memory("push_local_excludes");
@@ -459,6 +462,9 @@ void pop_local_excludes(void *mem)
                clear_exclude_list(lp);
        }
 
+       if (!pop)
+               return;
+
        for (i = 0, ap = pop; i < mergelist_cnt; i++) {
                memcpy(mergelist_parents[i]->u.mergelist, ap++,
                       sizeof (struct exclude_list_struct));