diff options
author | Sang-Hun Chung <sanghun.chung@samsung.com> | 2013-01-25 15:03:59 +0900 |
---|---|---|
committer | Sang-Hun Chung <sanghun.chung@samsung.com> | 2013-01-25 15:03:59 +0900 |
commit | 3b1719438fecf1650f97bdfe6862b789fef10360 (patch) | |
tree | 99c6f9f2ede0920c41f589afebbd61903b8f7e2a | |
parent | d71623ab3984ef8beaf2dc83e97e5bde96f2c402 (diff) | |
download | email-service-3b1719438fecf1650f97bdfe6862b789fef10360.tar.gz email-service-3b1719438fecf1650f97bdfe6862b789fef10360.tar.bz2 email-service-3b1719438fecf1650f97bdfe6862b789fef10360.zip |
prevent fixed
-rwxr-xr-x | email-core/email-core-account.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/email-core/email-core-account.c b/email-core/email-core-account.c index a6e6b47..a93c3cc 100755 --- a/email-core/email-core-account.c +++ b/email-core/email-core-account.c @@ -770,21 +770,19 @@ INTERNAL_FUNC void emcore_free_account(email_account_t *account) INTERNAL_FUNC void emcore_duplicate_account(const email_account_t *account, email_account_t **account_dup, int *err_code) { EM_DEBUG_FUNC_BEGIN("account[%p]", account); - int err = EMAIL_ERROR_NONE; - int ret = false; email_account_t *temp_account = NULL; - if(!account) { + if(!account || !account_dup) { /*prevent 40514*/ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM"); - err = EMAIL_ERROR_INVALID_PARAM; - goto FINISH_OFF; + if(err_code) *err_code = EMAIL_ERROR_INVALID_PARAM; + return; } *account_dup = em_malloc(sizeof(email_account_t)); - if (!*account_dup) { + if(!*account_dup) { /*prevent 40514*/ EM_DEBUG_EXCEPTION("malloc failed..."); - err = EMAIL_ERROR_OUT_OF_MEMORY; - goto FINISH_OFF; + if(err_code) *err_code = EMAIL_ERROR_OUT_OF_MEMORY; + return; } memcpy(*account_dup, account , sizeof(email_account_t)); @@ -807,21 +805,9 @@ INTERNAL_FUNC void emcore_duplicate_account(const email_account_t *account, emai temp_account->options.signature = EM_SAFE_STRDUP(account->options.signature); temp_account->certificate_path = EM_SAFE_STRDUP(account->certificate_path); - ret = true; - -FINISH_OFF: - - if (!ret) { - if (account_dup && *account_dup) - EM_SAFE_FREE(*account_dup); - - *account_dup = NULL; - } - if (err_code != NULL) - *err_code = err; + *err_code = EMAIL_ERROR_NONE; - return; EM_DEBUG_FUNC_END(); } |