The leak is basically impossible to reach, since the only common way
to get ferror(fp) is by passing a directory to -readconfig. In that
case, the error occurs before qdict is set to anything non-NULL.
However, it's theoretically possible to get there after an EIO.
Cc: [email protected]
Reported-by: Peter Maydell <[email protected]>
Fixes: f7544edcd3 ("qemu-config: add error propagation to qemu_config_parse", 2021-03-06)
Signed-off-by: Paolo Bonzini <[email protected]>
if (ferror(fp)) {
loc_pop(&loc);
error_setg_errno(errp, errno, "Cannot read config file");
- return res;
+ goto out_no_loc;
}
res = count;
if (qdict) {
}
out:
loc_pop(&loc);
+out_no_loc:
qobject_unref(qdict);
return res;
}