mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
Fix virRealloc bug for zero-size
This commit is contained in:
parent
7e0d3e62e9
commit
0c4a048485
@ -1,3 +1,8 @@
|
||||
Fri Oct 10 19:16:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/memory.c: If size*count== 0, then virRelloc must not
|
||||
return a failure, it is same as virFree.
|
||||
|
||||
Fri Oct 10 17:51:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* docs/libvirt.rng: Document SDL attributes in schema
|
||||
|
@ -158,7 +158,7 @@ int __virReallocN(void *ptrptr, size_t size, size_t count)
|
||||
return -1;
|
||||
}
|
||||
tmp = realloc(*(void**)ptrptr, size * count);
|
||||
if (!tmp)
|
||||
if (!tmp && (size * count))
|
||||
return -1;
|
||||
*(void**)ptrptr = tmp;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user