Fix svace issue 95/149195/1 accepted/tizen/unified/20170913.071327 submit/tizen/20170912.053101
authorsinikang <sinikang@samsung.com>
Tue, 12 Sep 2017 01:34:18 +0000 (10:34 +0900)
committersinikang <sinikang@samsung.com>
Tue, 12 Sep 2017 01:34:18 +0000 (10:34 +0900)
Change-Id: Ibed5eed1af0b0fb221ca96fb8a4f2b4de0389d83

packaging/capi-telephony.spec
src/telephony_sim.c

index 219b178..29fd78d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-telephony
 Summary:    Telephony Core API
-Version:    0.1.76
+Version:    0.1.77
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 7958f46..3f92db9 100644 (file)
@@ -162,6 +162,11 @@ int telephony_sim_get_operator(telephony_h handle, char **sim_operator)
                if (ret == TAPI_API_SUCCESS) {
                        int len = strlen(sim_imsi_info.szMcc) + strlen(sim_imsi_info.szMnc);
                        *sim_operator = malloc(len + 1);
+                       if (*sim_operator == NULL) {
+                               LOGE("OUT_OF_MEMORY");
+                               error_code = TELEPHONY_ERROR_OUT_OF_MEMORY;
+                               return error_code;
+                       }
                        snprintf(*sim_operator, len + 1, "%s%s", sim_imsi_info.szMcc, sim_imsi_info.szMnc);
                        LOGI("SIM operator: [%s]", *sim_operator);
                /* LCOV_EXCL_START */