Fix for Double free error check in FMessaging 2.1b_release accepted/tizen_2.1/20130426.150459 submit/tizen_2.1/20130426.150017
authorshivakumar jagalur matt <shiva.jm@samsung.com>
Thu, 25 Apr 2013 11:13:38 +0000 (16:43 +0530)
committershivakumar jagalur matt <shiva.jm@samsung.com>
Thu, 25 Apr 2013 11:13:38 +0000 (16:43 +0530)
Change-Id: Id7d3deea639b48f32a566584f84c33682ec0ae75
Signed-off-by: shivakumar jagalur matt <shiva.jm@samsung.com>
src/FMsg_WapPushManagerImpl.cpp

index b50aa1a..0e5afd6 100644 (file)
@@ -264,6 +264,7 @@ _WapPushManagerImpl::UnregisterCondition(const Tizen::Base::String& wapApplicati
        msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_APPLICATON_ID_STR, pWapAppId, MAX_WAPPUSH_ID_LEN);
        msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_PACKAGE_NAME_STR, pPkgName, MSG_FILEPATH_LEN_MAX);
        free(pPkgName);
+       pPkgName = null;
        
        err = msg_delete_push_event(__msgHandle, pushInfo);
        msg_release_struct(&pushInfo);
@@ -285,8 +286,17 @@ _WapPushManagerImpl::UnregisterCondition(const Tizen::Base::String& wapApplicati
        return r;
 
 CATCH:
-       free(pPkgName);
-       msg_release_struct(&pushInfo);
+       if (pPkgName)
+       {
+               free(pPkgName);
+               pPkgName = null;
+       }
+
+       if (pushInfo)
+       {       
+               msg_release_struct(&pushInfo);
+               pushInfo = null;
+       }       
 
        if (pWapAppId)
        {