InProcServerWrapper null pointer dereference
authorHabib Virji <habib.virji@samsung.com>
Mon, 26 Sep 2016 22:26:15 +0000 (23:26 +0100)
committerZiran Sun <ziran.sun@samsung.com>
Tue, 27 Sep 2016 12:41:03 +0000 (12:41 +0000)
clientResponse is redundant or null pointer dereference

https://jira.iotivity.org/browse/IOT-1311

Change-Id: Id1f0d7088443bc875c6a99a20a4e30cdcbc4b4a0
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12239
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
resource/src/InProcServerWrapper.cpp

index 3d0ad0a..af1e51d 100644 (file)
@@ -654,11 +654,10 @@ namespace OC
                     }
 
                 }
+                OCRepresentation rep = parseRDResponseCallback(clientResponse);
+                std::thread exec(context->callback, rep, clientResponse->result);
+                exec.detach();
             }
-
-            OCRepresentation rep = parseRDResponseCallback(clientResponse);
-            std::thread exec(context->callback, rep, clientResponse->result);
-            exec.detach();
         }
         catch (OC::OCException& e)
         {