Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 338137 | Differences between
and this patch

Collapse All | Expand All

(-)ccache-2.4.orig/util.c (-9 / +4 lines)
Lines 185-201 Link Here
185
*/
185
*/
186
void *x_realloc(void *ptr, size_t size)
186
void *x_realloc(void *ptr, size_t size)
187
{
187
{
188
	void *p2;
188
	void *ret;
189
	if (!ptr) return x_malloc(size);
189
	ret = realloc(ptr, size);
190
	p2 = malloc(size);
190
	if (!ret) {
191
	if (!p2) {
192
		fatal("out of memory in x_realloc");
191
		fatal("out of memory in x_realloc");
193
	}
192
	}
194
	if (ptr) {
193
	return ret;
195
		memcpy(p2, ptr, size);
196
		free(ptr);
197
	}
198
	return p2;
199
}
194
}
200
195
201
196

Return to bug 338137