Add NULL check
authorsung.goo.kim <sung.goo.kim@samsung.com>
Tue, 22 Dec 2015 01:42:00 +0000 (10:42 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 22 Dec 2015 08:21:50 +0000 (17:21 +0900)
Change-Id: I20260d1fe233d7715615f11e7e02b9e079622a8e

lib/icl-lite-resource.c
lib/icl-presence.c

index beb71a0..6ade69b 100644 (file)
@@ -287,6 +287,7 @@ API int iotcon_lite_resource_create(const char *uri_path,
        RETVM_IF(ICL_URI_PATH_LENGTH_MAX < strlen(uri_path),
                        IOTCON_ERROR_INVALID_PARAMETER, "Invalid uri_path(%s)", uri_path);
        RETV_IF(NULL == res_types, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == resource_handle, IOTCON_ERROR_INVALID_PARAMETER);
 
        resource = calloc(1, sizeof(struct icl_lite_resource));
        if (NULL == resource) {
index 8b9dab2..39ba78d 100644 (file)
@@ -174,6 +174,7 @@ API int iotcon_add_presence_cb(const char *host_address,
 
        RETV_IF(NULL == icl_dbus_get_object(), IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == presence_handle, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (resource_type && (ICL_RESOURCE_TYPE_LENGTH_MAX < strlen(resource_type))) {
                ERR("The length of resource_type(%s) is invalid", resource_type);