blob: 8e2d44dc6137fc8074faa9790ef35a93c33d0ccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
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
|