[WGID-29067, 29068] Fix the Svace issues 86/55586/1 accepted/tizen/mobile/20151228.232826 accepted/tizen/tv/20151228.231852 accepted/tizen/wearable/20151228.231202 submit/tizen/20151228.081646
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 28 Dec 2015 04:37:15 +0000 (13:37 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 28 Dec 2015 04:37:56 +0000 (13:37 +0900)
Change-Id: I8feae7fbb49e787898f9f8ad853c2e21760f5be0
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/capi-network-tethering.spec
src/tethering.c

index fa18a49..e860353 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.0.27
+Version:       1.0.28
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 87d3d9f..3b028a9 100755 (executable)
@@ -272,12 +272,20 @@ static tethering_error_e __set_passphrase(const char *passphrase, const unsigned
        ret = ckmc_remove_data(alias);
        if (ret != CKMC_ERROR_NONE) {
                ERR("Fail to remove old data : %d", ret);
+
+               if (alias)
+                       free(alias);
+
                return TETHERING_ERROR_OPERATION_FAILED;
        }
 
        ret = ckmc_save_data(alias, ckmc_buf, ckmc_policy);
        if (ret != CKMC_ERROR_NONE) {
                ERR("Fail to save the passphrase : %d", ret);
+
+               if (alias)
+                       free(alias);
+
                return TETHERING_ERROR_OPERATION_FAILED;
        }
 
@@ -326,6 +334,10 @@ static tethering_error_e __get_passphrase(char *passphrase,
 
                if (ret == 0) {
                        ERR("generate_initial_passphrase failed : %d\n", *passphrase_len);
+
+                       if (alias)
+                               free(alias);
+
                        return TETHERING_ERROR_OPERATION_FAILED;
                } else {
                        *passphrase_len = ret;
@@ -333,6 +345,10 @@ static tethering_error_e __get_passphrase(char *passphrase,
 
                        if (__set_passphrase(passphrase, *passphrase_len) != TETHERING_ERROR_NONE) {
                                DBG("set_passphrase is failed : %s, %d", passphrase, *passphrase_len);
+
+                               if (alias)
+                                       free(alias);
+
                                return TETHERING_ERROR_OPERATION_FAILED;
                        }
                }