]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Force tor_malloc(0) to always be sane
authorNick Mathewson <nickm@torproject.org>
Thu, 8 Apr 2004 03:05:08 +0000 (03:05 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 8 Apr 2004 03:05:08 +0000 (03:05 +0000)
svn:r1558

src/common/util.c

index 935aadea925344a2cbe80003ad0770ecd3a8401e..c5dd6aa97db2a101737d81bb78a3dc0c6b3c707c 100644 (file)
 void *tor_malloc(size_t size) {
   void *result;
 
+  /* Some libcs don't do the right thing on size==0. Override them. */
+  if (size==0) {
+    size=1;
+  }
   result = malloc(size);
 
   if(!result) {