diff --git a/fdtget.c b/fdtget.c index 4377419..fb9d0e1 100644 --- a/fdtget.c +++ b/fdtget.c @@ -266,14 +266,20 @@ static int do_fdtget(struct display_info *disp, const char *filename, continue; } else { report_error(arg[i], node); + free(blob); return -1; } } prop = args_per_step == 1 ? NULL : arg[i + 1]; - if (show_data_for_item(blob, disp, node, prop)) + if (show_data_for_item(blob, disp, node, prop)) { + free(blob); return -1; + } } + + free(blob); + return 0; }