X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jcc.c;h=8628084a62bfaa58b38c50d47b91b581a6510080;hb=05055fdcf42172570de3e1644bf6a1555da69582;hp=cb81afee374a34b89491be38191debdd3d7474e7;hpb=0adca031dd2e4293e09322d9a9c73ab60c8b6446;p=privoxy.git diff --git a/jcc.c b/jcc.c index cb81afee..8628084a 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.2 2002/11/20 14:37:47 oes Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.3 2003/02/28 12:53:06 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/Attic/jcc.c,v $ @@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.2 2002/11/20 14:37:47 oes Exp $"; * * Revisions : * $Log: jcc.c,v $ + * Revision 1.92.2.3 2003/02/28 12:53:06 oes + * Fixed two mostly harmless mem leaks + * * Revision 1.92.2.2 2002/11/20 14:37:47 oes * Fix: Head of global clients list now initialized to NULL * @@ -667,6 +670,16 @@ static int32 server_thread(void *data); #define sleep(N) DosSleep(((N) * 100)) #endif +#ifdef OSX_DARWIN +/* + * Hit OSX over the head with a hammer. Protect all *_r functions. + */ +pthread_mutex_t gmtime_mutex; +pthread_mutex_t localtime_mutex; +pthread_mutex_t gethostbyaddr_mutex; +pthread_mutex_t gethostbyname_mutex; +#endif /* def OSX_DARWIN */ + #if defined(unix) || defined(__EMX__) const char *basedir; const char *pidfile = NULL; @@ -1846,6 +1859,16 @@ int main(int argc, const char *argv[]) InitWin32(); #endif +#ifdef OSX_DARWIN + /* + * Prepare global mutex semaphores + */ + pthread_mutex_init(&gmtime_mutex,0); + pthread_mutex_init(&localtime_mutex,0); + pthread_mutex_init(&gethostbyaddr_mutex,0); + pthread_mutex_init(&gethostbyname_mutex,0); +#endif /* def OSX_DARWIN */ + /* * Unix signal handling *