Fix memory leak 19/255519/1
authorjusung <jusung07.son@samsung.com>
Fri, 19 Mar 2021 04:28:47 +0000 (13:28 +0900)
committerjusung <jusung07.son@samsung.com>
Fri, 19 Mar 2021 04:30:19 +0000 (13:30 +0900)
Change-Id: I37ca69f7eb682a4c7a94614b462dff4e410df3f4
Signed-off-by: jusung <jusung07.son@samsung.com>
src/rpc-port-parcel.cc

index 2276a77..625bbd9 100644 (file)
@@ -84,8 +84,10 @@ RPC_API int rpc_port_parcel_create_from_port(rpc_port_parcel_h* h,
 
   parcel_h parcel = nullptr;
   int ret = parcel_create(&parcel);
-  if (ret != PARCEL_ERROR_NONE)
+  if (ret != PARCEL_ERROR_NONE) {
+    delete[] buf;
     return RPC_PORT_ERROR_IO_ERROR;
+  }
 
   parcel_burst_write(parcel, buf, len);
   delete[] buf;