From: Philippe Coval Date: Thu, 15 Jun 2017 09:13:46 +0000 (+0200) Subject: resource-directory: Fix uninitialised value X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=423eb833e348fe94b98793da7e226afd28ab0236;p=platform%2Fupstream%2Fiotivity.git resource-directory: Fix uninitialised value resource-directory: Fix condition on uninitialised value Issue was observed using valgrind on GNU/Linux: https://build.iotivity.org/ci/job/iotivity-verify-unit_tests/16067/valgrindResult/pid=13739,0x2/ Bug: https://jira.iotivity.org/browse/IOT-2279 Change-Id: Ide0a2cca989466fefd4a13b41cc81bf38fa8afff Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/20829 Reviewed-by: Habib Virji (cherry picked from commit bb85bde7d79e49580fe0c90dbcf0746f585c0ad4) Reviewed-on: https://gerrit.iotivity.org/gerrit/21387 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- diff --git a/resource/csdk/resource-directory/src/rd_client.c b/resource/csdk/resource-directory/src/rd_client.c index f9ab5d4..5df7c7c 100644 --- a/resource/csdk/resource-directory/src/rd_client.c +++ b/resource/csdk/resource-directory/src/rd_client.c @@ -181,7 +181,7 @@ static OCRepPayload *RDPublishPayloadCreate(const unsigned char *id, ifs[1] = OICStrdup(OC_RSRVD_INTERFACE_DEFAULT); OCRepPayloadSetStringArrayAsOwner(rdPayload, OC_RSRVD_INTERFACE, ifs, dim); - char *n; + char *n = NULL; OCGetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, (void **) &n); if (n) {