char *pwd = NULL;
int ret = connection_profile_get_cellular_auth_info(profile_cellular, &type, &name, &pwd);
- FREE_RESOURCE(name); FREE_RESOURCE(pwd);
+ if (ret == CONNECTION_ERROR_NONE) {
+ FREE_RESOURCE(name);
+ FREE_RESOURCE(pwd);
+ }
if (telephony_supported)
CHECK_RETURN("connection_profile_get_cellular_auth_info", ret, CONNECTION_ERROR_NONE);