RPM Community Forums

Mailing List Message of <popt-devel>

man page does not document whether dynamically allocated memory has to be freed

From: Robert Scheck <robert@rpm5.org>
Date: Sun 24 Nov 2013 - 17:21:10 CET
Message-ID: <20131124162110.GA28784@hurricane.linuxnetz.de>
Hello all,

I am forwarding a message of Christoph Anton Mitterer (Cc'ed) which was
reported at Red Hat Bugzilla. However this does not feel for me like a
downstream thing but more relevant for popt upstream, thus relaying it:

----- Forwarded message -----
Hi.

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[0],
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.


Cheers,
Chris.

[0] 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.
----- End forwarded message -----

Foreign references for this request are:

 - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666245
 - https://bugzilla.redhat.com/show_bug.cgi?id=811799


Greetings,
  Robert


  • application/pgp-signature attachment: stored
Received on Sun Nov 24 17:21:18 2013
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.