summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@banu.com>2008-03-30 17:43:32 -0700
committerMukund Sivaraman <muks@banu.com>2008-03-30 17:43:32 -0700
commit12501d599cafa3774bec6ed6d0e8eb95a65a1e10 (patch)
treefbd004dd8ef786b6b1f283fef19e2f612f729561
parentbd8f8807ff9fa85f0e27e165d8f64ea415e743f1 (diff)
downloadtinyproxy-12501d599cafa3774bec6ed6d0e8eb95a65a1e10.tar.gz
tinyproxy-12501d599cafa3774bec6ed6d0e8eb95a65a1e10.zip
Fixed leaks of va_lists
Diffstat (limited to '')
-rw-r--r--src/log.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/log.c b/src/log.c
index 1fe5cc8..00bb43f 100644
--- a/src/log.c
+++ b/src/log.c
@@ -138,22 +138,19 @@ log_message(int level, char *fmt, ...)
if (!log_message_storage) {
log_message_storage = vector_create();
if (!log_message_storage)
- return;
+ goto out;
}
vsnprintf(str, STRING_LENGTH, fmt, args);
entry_buffer = safemalloc(strlen(str) + 6);
if (!entry_buffer)
- return;
+ goto out;
sprintf(entry_buffer, "%d %s", level, str);
vector_append(log_message_storage, entry_buffer,
strlen(entry_buffer) + 1);
-
- va_end(args);
-
- return;
+ goto out;
}
#ifdef HAVE_SYSLOG_H
if (config.syslog) {
@@ -185,6 +182,7 @@ log_message(int level, char *fmt, ...)
}
#endif
+ out:
va_end(args);
}