[perl-Gtk2] Avoid a potential leak in sv_from_iter



commit ea6e7e83cb511d81ec0133d7f73e8d109f89e584
Author: Kevin Ryde <user42 zip com au>
Date:   Wed Mar 31 19:40:28 2010 +0200

    Avoid a potential leak in sv_from_iter
    
    https://bugzilla.gnome.org/show_bug.cgi?id=614423

 xs/GtkTreeModel.xs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/xs/GtkTreeModel.xs b/xs/GtkTreeModel.xs
index 75676ca..11235c6 100644
--- a/xs/GtkTreeModel.xs
+++ b/xs/GtkTreeModel.xs
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2005 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003-2005, 2010 by the gtk2-perl team (see the file AUTHORS)
  *
  * Licensed under the LGPL, see LICENSE file for more information.
  *
@@ -180,9 +180,10 @@ gtk2perl_tree_model_get_column_type (GtkTreeModel *tree_model,
 static SV *
 sv_from_iter (GtkTreeIter * iter)
 {
-	AV * av = newAV ();
+	AV * av;
 	if (!iter)
 		return &PL_sv_undef;
+	av = newAV ();
 	av_push (av, newSVuv (iter->stamp));
 	av_push (av, newSViv (PTR2IV (iter->user_data)));
 	av_push (av, iter->user_data2 ? newRV (iter->user_data2) : &PL_sv_undef);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]