From 283177213f5bfe2052d59a5f197e2e32f04af5f3 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 14 Nov 2016 13:40:39 +0900 Subject: [PATCH] Fix memory leak issue - RQ161111-00886 "ecore_shutdown()" and other shutdown function has been called or not , after called "ecore_init()" successfully. So it modify every return case. Change-Id: If980244432b29bf13904c0d5e0550c532377fbe4 --- src/bin/notify-send.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/bin/notify-send.c b/src/bin/notify-send.c index 4c89430..549685f 100644 --- a/src/bin/notify-send.c +++ b/src/bin/notify-send.c @@ -117,11 +117,11 @@ main(int argc, char **argv) switch (ch) { case '?': usage(); - return EXIT_SUCCESS; + goto exit_success; break; case 'v': version(); - return EXIT_SUCCESS; + goto exit_success; break; case 'n': e_notification_app_name_set(n, optarg); @@ -138,15 +138,15 @@ main(int argc, char **argv) break; case 't': if (!read_int_arg(&value, "-t", INT_MIN, INT_MAX)) - return EXIT_FAILURE; + goto exit_failure; else e_notification_timeout_set(n, (int)value); break; case 'r': if (!read_int_arg(&value, "-r", 0, UINT_MAX)) - return EXIT_FAILURE; + goto exit_failure; else - e_notification_replaces_id_set(n, (unsigned int)value); + e_notification_replaces_id_set(n, (unsigned int)value); break; case 'i': e_notification_app_icon_set(n, optarg); @@ -159,7 +159,7 @@ main(int argc, char **argv) break; default: usage(); - return EXIT_FAILURE; + goto exit_failure; } argc -= optind; argv += optind; @@ -167,7 +167,7 @@ main(int argc, char **argv) if (argc < 1) { usage(); - return EXIT_FAILURE; + goto exit_failure; } e_notification_summary_set(n, argv[0]); @@ -182,10 +182,19 @@ main(int argc, char **argv) else e_notification_send(n, NULL, NULL); +exit_success: e_notification_unref(n); e_notification_shutdown(); ecore_shutdown(); eina_shutdown(); return EXIT_SUCCESS; + +exit_failure: + e_notification_unref(n); + e_notification_shutdown(); + ecore_shutdown(); + eina_shutdown(); + + return EXIT_FAILURE; } -- 2.7.4