[PATCH 13/14] libsmartcols: avoid variable dereference after release

Sami Kerola
2014-07-13T20:25:40Z

libsmartcols/src/line.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libsmartcols/src/line.c b/libsmartcols/src/line.c
index ab2f191..6e83fb4 100644
--- a/libsmartcols/src/line.c
+++ b/libsmartcols/src/line.c
@@ -199,9 +199,9 @@ int scols_line_remove_child(struct libscols_line *ln, struct libscols_line *chil
DBG(LINE, ul_debugobj(ln, "remove child %p", child));

list_del_init(&child->ln_children);
+ child->parent = NULL;
scols_unref_line(child);

- child->parent = NULL;
scols_unref_line(ln);
return 0;
}
--
2.0.1