Add NULL check logig 87/75187/1 accepted/tizen/common/20160617.121807 accepted/tizen/ivi/20160617.082922 accepted/tizen/mobile/20160617.084341 accepted/tizen/tv/20160617.084159 accepted/tizen/wearable/20160617.084359 submit/tizen/20160617.052858
authorYunmi Ha <yunmi.ha@samsung.com>
Fri, 17 Jun 2016 04:35:20 +0000 (13:35 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Fri, 17 Jun 2016 04:35:20 +0000 (13:35 +0900)
After malloc, need to check return value.

Change-Id: Ifcf45e72ea6c27389ff40548a1632ed6574f868d
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/common/tlm-utils.c

index 4f0b6b2..22c3ea9 100755 (executable)
@@ -844,6 +844,8 @@ static int func_conv(
 
     TlmLoginInfo *info = (TlmLoginInfo *)pdata;
     *resps = g_malloc0 (num_msg * sizeof(struct pam_response));
+    if (!*resps)
+        return PAM_CONV_ERR;
 
     for (i=0; i<num_msg; ++i) {
         struct pam_response *resp = *resps + i;