Changed the behaviour if trying to realloc a memory chunk of size 0 to

be consistent across systems (an error would be generated on Ubuntu when
no primers found)
This commit is contained in:
Celine Mercier
2017-11-29 14:25:14 +01:00
parent a75191bbe6
commit 2b3a331602

View File

@ -54,8 +54,14 @@ void *eco_realloc(void *chunk,
{ {
void *newchunk; void *newchunk;
newchunk = realloc(chunk,newsize); if (newsize == 0)
{
if (chunk)
free(chunk);
return NULL;
}
newchunk = realloc(chunk,newsize);
if (!newchunk) if (!newchunk)
{ {