comparison dbutil.c @ 123:a0db9a23f6d4

calloc memory rather than mallocing it - can't hurt too much, and is probably a bit safer
author Matt Johnston <matt@ucc.asn.au>
date Tue, 14 Sep 2004 13:18:16 +0000
parents e0acad552a92
children 82fcf3185616
comparison
equal deleted inserted replaced
122:cb7ef2f63bf0 123:a0db9a23f6d4
542 void* ret; 542 void* ret;
543 543
544 if (size == 0) { 544 if (size == 0) {
545 dropbear_exit("m_malloc failed"); 545 dropbear_exit("m_malloc failed");
546 } 546 }
547 ret = malloc(size); 547 ret = calloc(1, size);
548 if (ret == NULL) { 548 if (ret == NULL) {
549 dropbear_exit("m_malloc failed"); 549 dropbear_exit("m_malloc failed");
550 } 550 }
551 return ret; 551 return ret;
552 552