ofp-parse: Fix memory leak on error path in parse_ofp_group_mod_file().
Found by Coverity.
Reported-by:
Acked-by: Justin Pettit
@@ -1888,7 +1888,9 @@ parse_ofp_group_mod_file(const char *file_name,
fclose(stream);
}
- return xasprintf("%s:%d: %s", file_name, line_number, error);
+ char *ret = xasprintf("%s:%d: %s", file_name, line_number, error);
+ free(error);
+ return ret;
}
*usable_protocols &= usable;
*n_gms += 1;
