summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-14 10:28:51 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-14 10:28:51 +0100
commit190d34beb4495ace579333ab664329c210eebda3 (patch)
treed08c12dfb1cfe4f12e1eedc2cf75db1804b2393a
parent9149fe9fafb916c50e29820050901f51f4b88ff0 (diff)
Fix 2 memory leaks.v2.0.1
- One leak concerning the Log structure not being freed if there is a rule matching it that has delete = 1 - One leak happening when elasticsearch server is down.
-rw-r--r--src/bin/log.c3
-rw-r--r--src/lib/store/store_event.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/log.c b/src/bin/log.c
index 4f0015d..4bd64e7 100644
--- a/src/bin/log.c
+++ b/src/bin/log.c
@@ -177,10 +177,11 @@ log_line_event(void *data,
177 eina_iterator_free(it); 177 eina_iterator_free(it);
178 178
179 if (log->todel) 179 if (log->todel)
180 return EINA_TRUE; 180 goto log_end;
181 181
182 _log_send(smman, log); 182 _log_send(smman, log);
183 183
184log_end:
184 _log_free(log); 185 _log_free(log);
185 return EINA_TRUE; 186 return EINA_TRUE;
186} 187}
diff --git a/src/lib/store/store_event.c b/src/lib/store/store_event.c
index 2c60261..45b2010 100644
--- a/src/lib/store/store_event.c
+++ b/src/lib/store/store_event.c
@@ -71,13 +71,15 @@ store_event_complete(void *data,
71 eina_strbuf_string_get(sa->data.buf)); 71 eina_strbuf_string_get(sa->data.buf));
72 sa->cb.error((void *)sa->cb.data, sa->store, errstr); 72 sa->cb.error((void *)sa->cb.data, sa->store, errstr);
73 free(errstr); 73 free(errstr);
74 return EINA_TRUE; 74 goto complete_end;
75 } 75 }
76 76
77 sa->cb.done((void *)sa->cb.data, 77 sa->cb.done((void *)sa->cb.data,
78 sa->store, 78 sa->store,
79 (char *)eina_strbuf_string_get(sa->data.buf), 79 (char *)eina_strbuf_string_get(sa->data.buf),
80 eina_strbuf_length_get(sa->data.buf)); 80 eina_strbuf_length_get(sa->data.buf));
81
82complete_end:
81 store_add_free(sa); 83 store_add_free(sa);
82 return EINA_TRUE; 84 return EINA_TRUE;
83} 85}