Fix SVACE issue 52/141652/1 accepted/tizen/4.0/unified/20170829.015900 accepted/tizen/unified/20170808.171143 submit/tizen/20170807.074858 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004 tizen_4.0.IoT.p1_release
authorHongkuk, Son <hongkuk.son@samsung.com>
Tue, 1 Aug 2017 08:11:00 +0000 (17:11 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Tue, 1 Aug 2017 08:13:31 +0000 (17:13 +0900)
 - WGID 260267 : DEREF_OF_NULL.RET.ALLOC

Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: I9d8ed3f426f3552fd1c85bf49c934bc9d08dfa0f

src/ic-ioty-ocprocess.c

index 2b30f53..47be083 100644 (file)
@@ -761,6 +761,15 @@ OCEntityHandlerResult icl_ioty_ocprocess_request_cb(OCEntityHandlerFlag flag,
        icl_request_container_s *req_container = calloc(1, sizeof(icl_request_container_s));
        if (NULL == req_container) {
                ERR("calloc() Fail(%d)", errno);
+               free(host_address);
+               if (options)
+                       icl_options_destroy(options);
+               if (query)
+                       icl_query_destroy(query);
+               if (repr)
+                       icl_representation_destroy(repr);
+               if (req)
+                       free(req);
                return OC_EH_ERROR;
        }
        req_container->request = req;