openbsd-ports/devel/ccache/patches/patch-util_c
jolan 115a964d06 fix crash when passing long command lines
from andrew dalgleish via ben lovett
2006-01-23 03:27:52 +00:00

19 lines
427 B
Plaintext

$OpenBSD: patch-util_c,v 1.1 2006/01/23 03:27:53 jolan Exp $
--- util.c.orig Sun Jan 22 17:16:46 2006
+++ util.c Sun Jan 22 17:17:15 2006
@@ -187,13 +187,9 @@ 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;
}