From: JunsuChoi Date: Mon, 14 Nov 2016 04:40:39 +0000 (+0900) Subject: Fix memory leak issue - RQ161111-00886 X-Git-Tag: accepted/tizen/4.0/unified/20170816.010552~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=refs%2Fchanges%2F28%2F124328%2F1;p=platform%2Fupstream%2Fedbus.git 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 --- 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; }