ocstack: handler check 70/29570/2
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Wed, 26 Jun 2019 10:52:42 +0000 (13:52 +0300)
committerAleksey Volkov <a.volkov@samsung.com>
Thu, 11 Jul 2019 10:40:43 +0000 (10:40 +0000)
Check ehResponseHandler in serverRequest before call

Change-Id: I575ca777bbe13f50c15ff5fb9c58cb5730eee584
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/stack/src/ocstack.c

index 91cbb8e..a17b39f 100644 (file)
@@ -4452,7 +4452,7 @@ OCStackResult OC_CALL OCBindResourceAM(
     }
     else
     {
-        
+
         newChildResource->rsrcResource->amEntityHandler = NULL;
     }
 
@@ -5231,7 +5231,7 @@ OCStackResult OC_CALL OCDoResponse(OCEntityHandlerResponse *ehResponse)
     // Normal response
     // Get pointer to request info
     serverRequest = (OCServerRequest *)ehResponse->requestHandle;
-    if(serverRequest)
+    if(serverRequest && serverRequest->ehResponseHandler)
     {
         // response handler in ocserverrequest.c. Usually HandleSingleResponse.
         result = serverRequest->ehResponseHandler(ehResponse);