projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add #141: Port Privoxy to CloudABI
[privoxy.git]
/
miscutil.c
diff --git
a/miscutil.c
b/miscutil.c
index
f04344c
..
b468fc6
100644
(file)
--- a/
miscutil.c
+++ b/
miscutil.c
@@
-1,4
+1,4
@@
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.7
7 2012/07/23 12:41:59
fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.7
8 2012/11/24 13:58:17
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
@@
-151,6
+151,14
@@
void *malloc_or_die(size_t buffer_size)
{
char *new_buf;
{
char *new_buf;
+ if (buffer_size == 0)
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "malloc_or_die() called with buffer size 0");
+ assert(buffer_size != 0);
+ buffer_size = 4096;
+ }
+
new_buf = malloc(buffer_size);
if (new_buf == NULL)
new_buf = malloc(buffer_size);
if (new_buf == NULL)