From: Wayne Davison Date: Tue, 25 Jan 2005 02:30:59 +0000 (+0000) Subject: Don't try to allocate zero bytes in push_local_excludes(). X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/a2b371cd52a905c1daba161e2adf721a4a911c1d Don't try to allocate zero bytes in push_local_excludes(). --- diff --git a/exclude.c b/exclude.c index a0a94725..10f246e0 100644 --- 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));