From 22a5e4caff566cdcf26f194e45bc5f5f8c6164e3 Mon Sep 17 00:00:00 2001 From: Netaji Panigrahi <114923459+NetajiPanigrahi@users.noreply.github.com> Date: Fri, 28 Jun 2024 08:16:15 +0530 Subject: [PATCH] "rbuscli get Device.WiFi." failed with Segmentation fault (#209) Reason for change: The crash occurred due to an invalid memory access. The rbusProperty_Release() function is to release local variables that have previously been freed. To resolve the problem, the local variable was initialized with "NULL". Signed-off-by: Netaji Panigrahi Netaji_Panigrahi@comcast.com --- src/rbus/rbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rbus/rbus.c b/src/rbus/rbus.c index 8f5b565c..938c577e 100644 --- a/src/rbus/rbus.c +++ b/src/rbus/rbus.c @@ -3494,7 +3494,7 @@ rbusError_t rbus_getExt(rbusHandle_t handle, int paramCount, char const** pParam } else { - rbusProperty_t tmpProperties; + rbusProperty_t tmpProperties = NULL; if((errorcode = _getExt_response_parser(response, &tmpNumOfValues, &tmpProperties)) != RBUS_ERROR_SUCCESS) { @@ -3642,7 +3642,7 @@ rbusError_t rbus_getExt(rbusHandle_t handle, int paramCount, char const** pParam } else { - rbusProperty_t batchResult; + rbusProperty_t batchResult = NULL; int batchNumVals; if((errorcode = _getExt_response_parser(response, &batchNumVals, &batchResult)) != RBUS_ERROR_SUCCESS) {