[augeas-devel] 3 small patches
David Lutterkort
lutter at redhat.com
Thu Jan 8 17:42:48 UTC 2009
On Thu, 2009-01-08 at 14:33 +0100, Jim Meyering wrote:
> [PATCH 1/3] test ls output more portably in face of SELinux differences
> [PATCH 2/3] plug a leak
> [PATCH 3/3] comment typos
ACK to all, I'll commit them shortly.
> >From a006802e57ca2acd58d318607d539a0fa5835d07 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Sun, 28 Dec 2008 16:25:59 +0100
> Subject: [PATCH 2/3] plug a leak
>
> 24 bytes in 1 blocks are definitely lost in loss record 1 of 1
> at 0x4021BDE: calloc (vg_replace_malloc.c:397)
> by 0x4029379: make_tree (augeas.c:316)
> by 0x403AC70: get_lens (get.c:592)
> by 0x403ACB6: get_lens (get.c:523)
> by 0x403AB4F: get_lens (get.c:474)
> by 0x403ACDE: get_lens (get.c:523)
> by 0x403AB4F: get_lens (get.c:474)
> by 0x403AF20: lns_get (get.c:684)
> by 0x4034E81: lens_get (builtin.c:124)
> by 0x402CDC7: native_call (syntax.c:967)
> by 0x402F4C9: compile_exp (syntax.c:1574)
> by 0x402EF17: compile_exp (syntax.c:1487)
> by 0x402FEEC: __aug_load_module_file (syntax.c:1600)
> by 0x80489AE: main (augparse.c:86)
> ---
> src/builtin.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/builtin.c b/src/builtin.c
> index 8d862c0..e5c475a 100644
> --- a/src/builtin.c
> +++ b/src/builtin.c
> @@ -126,7 +126,10 @@ static struct value *lens_get(struct info *info, struct value *l,
> v = make_value(V_TREE, ref(info));
> v->origin = make_tree_origin(tree);
> } else {
> - tree = make_tree_origin(tree);
> + struct tree *t = make_tree_origin(tree);
> + if (t == NULL)
> + free_tree(tree);
> + tree = t;
>
> v = make_exn_lns_error(info, err, text);
> if (tree != NULL) {
> --
> 1.6.1.141.gfe98e
How did you run into this ? Did you run augeas through an allocater that
fails occasionally (since that's the only reason for make_tree_origin to
return NULL)
thanks for all these,
David
More information about the augeas-devel
mailing list