From a2b371cd52a905c1daba161e2adf721a4a911c1d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 25 Jan 2005 02:30:59 +0000 Subject: [PATCH] Don't try to allocate zero bytes in push_local_excludes(). --- exclude.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)); -- 2.34.1