Check NULL of out parameter
authorsung.goo.kim <sung.goo.kim@samsung.com>
Tue, 5 Jan 2016 03:08:57 +0000 (12:08 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 5 Jan 2016 08:35:21 +0000 (17:35 +0900)
Change-Id: I165c80e9a226c23b771723cab514bdaa4c558e6b

lib/icl-remote-resource.c
lib/icl-response.c

index 9eba769..a802d5a 100644 (file)
@@ -292,6 +292,7 @@ API int iotcon_remote_resource_clone(iotcon_remote_resource_h src,
        iotcon_remote_resource_h resource = NULL;
 
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
 
        resource = calloc(1, sizeof(struct icl_remote_resource));
        if (NULL == resource) {
index 05d4104..cb7466d 100644 (file)
@@ -69,6 +69,7 @@ API int iotcon_response_get_options(iotcon_response_h resp,
                iotcon_options_h *options)
 {
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resp->header_options, IOTCON_ERROR_NO_DATA);
 
        *options = resp->header_options;
@@ -80,6 +81,7 @@ API int iotcon_response_get_representation(iotcon_response_h resp,
                iotcon_representation_h *repr)
 {
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resp->repr, IOTCON_ERROR_NO_DATA);
 
        *repr = resp->repr;
@@ -92,6 +94,7 @@ API int iotcon_response_get_result(iotcon_response_h resp,
                iotcon_response_result_e *result)
 {
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == result, IOTCON_ERROR_INVALID_PARAMETER);
 
        *result = resp->result;