From b45b1606db28e031b1fd5a5bea0f32a63a0754dc Mon Sep 17 00:00:00 2001 From: Ashish Dhiman Date: Mon, 9 Feb 2015 12:49:29 +0530 Subject: [PATCH] Klockwork P1 issues. fixing Klockwork P1 issues. CRs-Fixed: 793601 Change-Id: I037c17c342f473d6d21a234ec1e980ba55b98cbe --- utils/loc_cfg.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 404f3ed2..7ffe6a43 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -329,9 +329,14 @@ int loc_update_conf(const char* conf_data, int32_t length, if (conf_data && length && config_table && table_length) { // make a copy, so we do not tokenize the original data char* conf_copy = (char*)malloc(length+1); - memcpy(conf_copy, conf_data, length); - // we hard NULL the end of string to be safe - conf_copy[length] = 0; + + if(conf_copy !=NULL) + { + memcpy(conf_copy, conf_data, length); + // we hard NULL the end of string to be safe + conf_copy[length] = 0; + } + // start with one record off uint32_t num_params = table_length - 1; char* saveptr = NULL;