Add missing unlock 54/51654/2 accepted/tizen/mobile/20151112.074641 accepted/tizen/tv/20151112.074701 accepted/tizen/wearable/20151112.074707 submit/tizen/20151112.040535
authorSemun Lee <sm79.lee@samsung.com>
Thu, 12 Nov 2015 00:20:09 +0000 (09:20 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Thu, 12 Nov 2015 02:02:09 +0000 (11:02 +0900)
Change-Id: I6ac76170d7b6bb276efcd6a9d9234e99d3285bd8
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
src/app_context.c

index 247e9da..13cee53 100644 (file)
@@ -449,6 +449,7 @@ int app_context_set_event_cb(app_manager_app_context_event_cb callback, void *us
 
                if (event_cb_context == NULL)
                {
+                       app_context_unlock_event_cb_context();
                        return app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
                }
 
@@ -456,6 +457,9 @@ int app_context_set_event_cb(app_manager_app_context_event_cb callback, void *us
 
                if (event_cb_context->pid_table == NULL)
                {
+                       free(event_cb_context);
+                       event_cb_context = NULL;
+                       app_context_unlock_event_cb_context();
                        return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, "failed to initialize pid-table");
                }