Red Hat Bugzilla – Bug 811799
manpage does not document whether dynamically allocated memory has to be freed
Last modified: 2013-11-24 11:49:52 EST
Popt has the options to "automatically update program variables when the option is used".
This is done by the argInfo and arg elements of option tables.
1) For all the pointer types, i.e. POPT_ARG_STRING and POPT_ARG_ARGV it does not document,
what kind of memory this is (I guess dynamically allocated) and whether the user has to
free this (I guess so).
This is especially missing in the section "1. THE OPTION TABLE".
2) Again, for all the pointer types, i.e. POPT_ARG_STRING and POPT_ARG_ARGV it does not
document, what happens to the memory previously pointed to by the arg variable.
I guess(!) this is not freed (it could have been dynamically allocated), so it should at
least be documented, that no special care is taken by popt.
 It does however document in section "3. PARSING THE COMMAND LINE", that the string returned
by poptGetOptArg() has to be freed by the user.
I guess the same should be the case for the variables set via POPT_ARG_STRING and POPT_ARG_ARGV.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.
(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)
More information and reason for this action is here:
I am very sorry, but I do really not see how I could help here as Fedora is
downstream of popt. But http://rpm5.org/community/popt-devel/0267.html is a
forward of this request to upstream for discussions there.
Upstream replied to this at http://rpm5.org/community/popt-devel/0271.html -
from my point of view, there is nothing left thus I am closing this report.
In case you disagree with me, feel free to subscribe popt-devel mailing list
at upstream and let us discuss your point directly with upstream.