1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Update Lua to 5.3.6

This commit is contained in:
dmiller
2022-08-31 18:39:45 +00:00
parent ea9344ef3d
commit 04bcefd3e4
12 changed files with 62 additions and 89 deletions

View File

@@ -1011,8 +1011,13 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
free(ptr);
return NULL;
}
else
return realloc(ptr, nsize);
else { /* cannot fail when shrinking a block */
void *newptr = realloc(ptr, nsize);
if (newptr == NULL && ptr != NULL && nsize <= osize)
return ptr; /* keep the original block */
else /* no fail or not shrinking */
return newptr; /* use the new block */
}
}