[Tarantool-patches] [PATCH v6 2/4] popen: Introduce a backend engine

Cyrill Gorcunov gorcunov at gmail.com
Fri Dec 20 15:10:23 MSK 2019


On Fri, Dec 20, 2019 at 03:04:46PM +0300, Konstantin Osipov wrote:
> * Cyrill Gorcunov <gorcunov at gmail.com> [19/12/20 14:56]:
> > > > +static void
> > > > +handle_free(struct popen_handle *handle)
> > > > +{
> > > > +	say_debug("popen: handle %p free %p", handle);
> > > > +	free(handle);
> > > > +}
> > > 
> > > I don't understand who owns char *command and why 
> > > it's not freed here. Could you please clarify?
> > 
> > Look, the command is compiled from argv array into
> > a single string dynamically allocated. The handle
> > just carries a reference to it. If you think it will
> > be more suitable to allocate command together with
> > handle itself in one place then sure I'll update.
> 
> Where is it freed?

popen_delete -> command_free


More information about the Tarantool-patches mailing list