Fix for:
CID
1251462 (#1 of 1): Use after free (USE_AFTER_FREE)
1. alias: Assigning: cur_name = names. Now both point to the same storage.
3. freed_arg: free frees names.
6. pass_freed_arg: Passing freed pointer cur_name as an argument to printf.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
printf("expected = %s\n", expected);
std::set<std::string>::iterator it = image_names.find(expected);
if (it != image_names.end()) {
- printf("found %s\n", cur_name);
+ printf("found %s\n", expected);
image_names.erase(it);
} else {
ADD_FAILURE() << "Unable to find image " << expected;