Changeset 86273 in vbox
- Timestamp:
- Sep 24, 2020 5:38:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/nsprpub/pr/src/malloc/prmem.c
r31259 r86273 470 470 471 471 #ifdef VBOX_USE_IPRT_IN_NSPR 472 return use_zone_allocator ? pr_ZoneMalloc(size) : RTMemAlloc( size);472 return use_zone_allocator ? pr_ZoneMalloc(size) : RTMemAlloc(RT_MAX(size, 1)); 473 473 #else 474 474 return use_zone_allocator ? pr_ZoneMalloc(size) : malloc(size); … … 482 482 return use_zone_allocator ? 483 483 #ifdef VBOX_USE_IPRT_IN_NSPR 484 pr_ZoneCalloc(nelem, elsize) : RTMemAllocZ( nelem * (size_t)elsize);484 pr_ZoneCalloc(nelem, elsize) : RTMemAllocZ(RT_MAX(nelem * (size_t)elsize, 1)); 485 485 #else 486 486 pr_ZoneCalloc(nelem, elsize) : calloc(nelem, elsize); … … 527 527 #else 528 528 # ifdef VBOX_USE_IPRT_IN_NSPR 529 return RTMemAlloc( size);529 return RTMemAlloc(RT_MAX(size, 1)); 530 530 # else 531 531 return malloc(size); … … 541 541 #else 542 542 # ifdef VBOX_USE_IPRT_IN_NSPR 543 return RTMemAllocZ( nelem * (size_t)elsize);543 return RTMemAllocZ(RT_MAX(nelem * (size_t)elsize, 1)); 544 544 # else 545 545 return calloc(nelem, elsize);
Note:
See TracChangeset
for help on using the changeset viewer.