(Bug) Removed wrong error message when destroying resource
authorsung.goo.kim <sung.goo.kim@samsung.com>
Wed, 21 Oct 2015 02:32:00 +0000 (11:32 +0900)
committeryoungman <yman.jung@samsung.com>
Tue, 3 Nov 2015 11:08:20 +0000 (20:08 +0900)
Change-Id: I818a5cd89f89a4429b1c8a81b18598f403eb58af

lib/icl-resource.c

index 718cc3e..9fdb2a5 100644 (file)
@@ -154,7 +154,8 @@ static void _icl_resource_conn_cleanup(iotcon_resource_h resource)
        }
 
        iotcon_resource_types_destroy(resource->types);
-       iotcon_observers_destroy(resource->observers);
+       if (resource->observers)
+               iotcon_observers_destroy(resource->observers);
        free(resource->uri_path);
        free(resource);
 }
@@ -257,7 +258,8 @@ API int iotcon_resource_destroy(iotcon_resource_h resource)
        if (0 == resource->sub_id) {
                WARN("Invalid Resource handle");
                iotcon_resource_types_destroy(resource->types);
-               iotcon_observers_destroy(resource->observers);
+               if (resource->observers)
+                       iotcon_observers_destroy(resource->observers);
                free(resource->uri_path);
                free(resource);
                return IOTCON_ERROR_NONE;