[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 3/5] xenstore: add explicit memory context parameter to read_node()
On Mon, Jul 18, 2016 at 09:31:27AM +0200, Juergen Gross wrote: > Add a parameter to xenstored read_node() function to explicitly > specify the memory context to be used for allocations. This will make > it easier to avoid memory leaks by using a context which is freed > soon. > > When calling read_node() select a sensible memory context for the new > parameter by preferring a temporary one. > > Signed-off-by: Juergen Gross <jgross@xxxxxxxx> > --- > tools/xenstore/xenstored_core.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c > index 9448ee8..e5c74f4 100644 > --- a/tools/xenstore/xenstored_core.c > +++ b/tools/xenstore/xenstored_core.c > @@ -398,7 +398,8 @@ bool is_child(const char *child, const char *parent) > } > > /* If it fails, returns NULL and sets errno. */ > -static struct node *read_node(struct connection *conn, const char *name) > +static struct node *read_node(struct connection *conn, const void *mem, > + const char *name) Same here: mem -> ctx or context. Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |