summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-26 16:50:55 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-26 16:50:55 +0000
commite9f5b2e75f13fc07f2aded138656d20db1be0e99 (patch)
treed40f5a2b17c953b9164636507ecfe2a5e0d7144a /src
parent0e7182533ce53592139e8ea35fab48b4ddaa43ae (diff)
Check the return value of hashmap_first()
Diffstat (limited to 'src')
-rw-r--r--src/log.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/log.c b/src/log.c
index 5ae6ded..9577e5f 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,4 +1,4 @@
-/* $Id: log.c,v 1.18 2002-04-25 18:56:43 rjkaes Exp $
+/* $Id: log.c,v 1.19 2002-04-26 16:50:55 rjkaes Exp $
*
* Logs the various messages which tinyproxy produces to either a log file or
* the syslog daemon. Not much to it...
@@ -159,13 +159,14 @@ send_stored_logs(void)
char *level;
char *string;
- for (iter = hashmap_first(log_message_storage);
- iter != hashmap_is_end(log_message_storage, iter);
- ++iter) {
- hashmap_return_entry(log_message_storage,
- iter,
- &string,
- (void **)&level);
+ iter = hashmap_first(log_message_storage);
+ if (iter >= 0) {
+ for ( ; iter != hashmap_is_end(log_message_storage, iter); ++iter) {
+ hashmap_return_entry(log_message_storage,
+ iter,
+ &string,
+ (void **)&level);
+ }
}
hashmap_delete(log_message_storage);