X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgi.c;h=52cccb926dd76b26fadaa04567bf4811aa656d74;hp=580e2bfb47439907e8665a350087f6fc78890373;hb=99ffe8553cc08f3784cfcd4e3cfb3cfefb3a4171;hpb=038436dace0ed97529a10ecc4fefb7f2f2c0b1a4 diff --git a/cgi.c b/cgi.c index 580e2bfb..52cccb92 100644 --- a/cgi.c +++ b/cgi.c @@ -537,7 +537,8 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp, *query_args_start++ = '\0'; param_list = new_map(); err = map(param_list, "file", 1, url_decode(query_args_start), 0); - if (JB_ERR_OK != err) { + if (JB_ERR_OK != err) + { free(param_list); free(path_copy); return cgi_error_memory(); @@ -1515,13 +1516,15 @@ static void get_locale_time(char *buf, size_t buffer_size) #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); timeptr = localtime(¤t_time); - privoxy_mutex_unlock(&localtime_mutex); #else timeptr = localtime(¤t_time); #endif strftime(buf, buffer_size, "%a %b %d %X %Z %Y", timeptr); +#if !defined(HAVE_LOCALTIME_R) && defined(MUTEX_LOCKS_AVAILABLE) + privoxy_mutex_unlock(&localtime_mutex); +#endif }