On 12/03/10 11:57, Stefan Hajnoczi wrote: > On Thu, Dec 2, 2010 at 5:46 PM, <jes.soren...@redhat.com> wrote: >> + create_options = append_option_parameters(create_options, >> + drv->create_options); >> + create_options = append_option_parameters(create_options, >> + proto_drv->create_options); >> + print_option_help(create_options); > > free_option_parameters(create_options);
Hmmm good point >> @@ -694,6 +720,11 @@ static int img_convert(int argc, char **argv) >> >> out_filename = argv[argc - 1]; >> >> + if (options && !strcmp(options, "?")) { >> + ret = print_block_option_help(out_filename, out_fmt); >> + goto out2; >> + } >> + >> if (bs_n > 1 && out_baseimg) { >> error("-B makes no sense when concatenating multiple input images"); >> return 1; >> @@ -749,10 +780,6 @@ static int img_convert(int argc, char **argv) >> drv->create_options); >> create_options = append_option_parameters(create_options, >> proto_drv->create_options); >> - if (options && !strcmp(options, "?")) { >> - print_option_help(create_options); >> - goto out; >> - } >> >> if (options) { >> param = parse_option_parameters(options, create_options, param); >> @@ -984,6 +1011,7 @@ out: >> } >> } >> free(bs); >> +out2: > > Not needed, out is fine. All those free functions are nops on NULL pointers. Actually tried that, but it segfaulted, which is why I added out2. Cheers, Jes