Fix memory leak 04/240104/1
authorYunmi Ha <yunmi.ha@samsung.com>
Mon, 3 Aug 2020 10:07:37 +0000 (19:07 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Mon, 3 Aug 2020 10:07:37 +0000 (19:07 +0900)
Change-Id: Ic7bb29c716b64c41677e16277472e1eb10f3f1c3
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/logutil/logutil.c

index 6fcf8e5..d8e2b07 100644 (file)
@@ -285,7 +285,7 @@ static int clear_buffer(dlogutil_state_s *state, log_id_t buffer)
 
 static int for_each_buffer(int enabled_buffers, int (*func)(dlogutil_state_s *state, log_id_t buffer))
 {
-       dlogutil_config_s *c = dlogutil_config_create();
+       __attribute__((cleanup(config_cleanup))) dlogutil_config_s *c = dlogutil_config_create();
        int r;
 
        for (int i = 0; i < LOG_ID_MAX; ++i) {