Merge "Fix Memory leak in util/loc_cfg.cpp"

This commit is contained in:
Linux Build Service Account 2015-06-13 12:00:47 -07:00 committed by Gerrit - the friendly Code Review server
commit 060ec8f697

View file

@ -335,7 +335,6 @@ int loc_update_conf(const char* conf_data, int32_t length,
memcpy(conf_copy, conf_data, length); memcpy(conf_copy, conf_data, length);
// we hard NULL the end of string to be safe // we hard NULL the end of string to be safe
conf_copy[length] = 0; conf_copy[length] = 0;
}
// start with one record off // start with one record off
uint32_t num_params = table_length - 1; uint32_t num_params = table_length - 1;
@ -349,6 +348,8 @@ int loc_update_conf(const char* conf_data, int32_t length,
num_params -= loc_fill_conf_item(input_buf, config_table, table_length); num_params -= loc_fill_conf_item(input_buf, config_table, table_length);
input_buf = strtok_r(NULL, "\n", &saveptr); input_buf = strtok_r(NULL, "\n", &saveptr);
} }
free(conf_copy);
}
} }
return ret; return ret;