projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3158661
)
Fix big memory leak.
author
steudten
<steudten@users.sourceforge.net>
Wed, 9 Jan 2002 19:05:45 +0000
(19:05 +0000)
committer
steudten
<steudten@users.sourceforge.net>
Wed, 9 Jan 2002 19:05:45 +0000
(19:05 +0000)
errlog.c
patch
|
blob
|
history
diff --git
a/errlog.c
b/errlog.c
index
0771cd6
..
5583137
100644
(file)
--- a/
errlog.c
+++ b/
errlog.c
@@
-1,4
+1,4
@@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.2
4 2001/12/30 14:07:32 steudten
Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.2
5 2002/01/09 14:32:08 oes
Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@
-33,6
+33,9
@@
const char errlog_rcs[] = "$Id: errlog.c,v 1.24 2001/12/30 14:07:32 steudten Exp
*
* Revisions :
* $Log: errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.25 2002/01/09 14:32:08 oes
+ * Added support for gmtime_r and localtime_r.
+ *
* Revision 1.24 2001/12/30 14:07:32 steudten
* - Add signal handling (unix)
* - Add SIGHUP handler (unix)
* Revision 1.24 2001/12/30 14:07:32 steudten
* - Add signal handling (unix)
* - Add SIGHUP handler (unix)
@@
-332,7
+335,7
@@
void log_error(int loglevel, char *fmt, ...)
{
va_list ap;
char *outbuf= NULL;
{
va_list ap;
char *outbuf= NULL;
- char *outbuf_save = NULL;
+
static
char *outbuf_save = NULL;
char * src = fmt;
int outc = 0;
long this_thread = 1; /* was: pthread_t this_thread;*/
char * src = fmt;
int outc = 0;
long this_thread = 1; /* was: pthread_t this_thread;*/
@@
-369,8
+372,12
@@
void log_error(int loglevel, char *fmt, ...)
this_thread = ptib -> tib_ptib2 -> tib2_ultid;
#endif /* def FEATURE_PTHREAD */
this_thread = ptib -> tib_ptib2 -> tib2_ultid;
#endif /* def FEATURE_PTHREAD */
- outbuf_save = outbuf = (char*)malloc(BUFFER_SIZE);
- assert(outbuf);
+ if ( !outbuf_save )
+ {
+ outbuf_save = outbuf = (char*)malloc(BUFFER_SIZE);
+ assert(outbuf);
+ }
+ outbuf = outbuf_save;
{
/*
{
/*