Fix the prevent defect in account plug-in lib
authorYoonchan Choi <yc81.choi@samsung.com>
Sat, 13 Apr 2013 10:34:54 +0000 (19:34 +0900)
committerYoonchan Choi <yc81.choi@samsung.com>
Sat, 13 Apr 2013 10:34:54 +0000 (19:34 +0900)
Change-Id: I32687f21135882ba7c8ac06aeb5ab12e20fc4737
Signed-off-by: Yoonchan Choi <yc81.choi@samsung.com>
pkgmgr_account/src/account.cpp

index 9fd5ff2..3e439a3 100644 (file)
@@ -68,9 +68,10 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
        ret = account_type_create(&accountTypeHandle);
        if (ret != ACCOUNT_ERROR_NONE || accountTypeHandle == null)
        {
-               SysLog(NID_SCL, "Memory allocation failed.");
-               account_disconnect();
+               ret = account_disconnect();
+               _SysTryReturn(NID_SCL, ret == ACCOUNT_ERROR_NONE, -1, "A system error has occurred.");
 
+               SysLog(NID_SCL, "Memory allocation failed.");
                return -ENOMEM;
        }