From: Andrew Tridgell Date: Mon, 17 Jul 2006 03:41:12 +0000 (+0200) Subject: fixed a bug in x_realloc() X-Git-Tag: v3.0pre0~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52a9cd8eb8a69f9dc6944c047faf112b7137a07b;p=thirdparty%2Fccache.git fixed a bug in x_realloc() --- diff --git a/util.c b/util.c index 073fa81c6..29d0e5b4c 100644 --- a/util.c +++ b/util.c @@ -187,14 +187,10 @@ void *x_realloc(void *ptr, size_t size) { void *p2; if (!ptr) return x_malloc(size); - p2 = malloc(size); + p2 = realloc(ptr, size); if (!p2) { fatal("out of memory in x_realloc"); } - if (ptr) { - memcpy(p2, ptr, size); - free(ptr); - } return p2; }