115a964d06
from andrew dalgleish via ben lovett
19 lines
427 B
Plaintext
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;
|
|
}
|