mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
Avoid double free when shrink-wrapping source data on fetch completion.
svn path=/trunk/netsurf/; revision=10423
This commit is contained in:
parent
98b690a900
commit
248a53f6ba
@ -1610,7 +1610,8 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
/* Shrink source buffer to required size */
|
/* Shrink source buffer to required size */
|
||||||
temp = realloc(object->source_data,
|
temp = realloc(object->source_data,
|
||||||
object->source_len);
|
object->source_len);
|
||||||
if (temp != NULL) {
|
/* If source_len is 0, then temp may be NULL */
|
||||||
|
if (temp != NULL || object->source_len == 0) {
|
||||||
object->source_data = temp;
|
object->source_data = temp;
|
||||||
object->source_alloc = object->source_len;
|
object->source_alloc = object->source_len;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user