This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] memory leak, mi-cmd-var
> 'nother one from Coverity.
>
> 2007-06-28 Michael Snyder <msnyder@access-company.com>
>
> * mi/mi-cmd-var.c (mi_cmd_var_set_format): Free strduped memory
> (Coverity). Also take the opportunity to call error earlier
> (before strdup).
> I don't see why the string has to be duplicated in the first place or how
> argv[1] could be NULL. Why not just:
Well... you're right! At least about the strdup.
About the NULL check -- it was already there, so I don't favor removing
it unles we can demonstrate that it can't be NULL. But I'll re-submit
after eliminating the strdup.