You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-util/ccache/files/ccache-2.4-xrealloc.patch

36 lines
742 B

https://bugzilla.samba.org/show_bug.cgi?id=7090
https://bugs.gentoo.org/338137
From 52a9cd8eb8a69f9dc6944c047faf112b7137a07b Mon Sep 17 00:00:00 2001
From: Andrew Tridgell <tridge@samba.org>
Date: Mon, 17 Jul 2006 05:41:12 +0200
Subject: [PATCH] fixed a bug in x_realloc()
---
util.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/util.c b/util.c
index 073fa81..29d0e5b 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;
}
--
1.7.3.1