[msitools] table: fix two leaks of a record object



commit c50b5304a40c3c0769f2545fdc044dfaf9042db3
Author: Paolo Bonzini <pbonzini redhat com>
Date:   Sat Apr 5 14:53:22 2014 +0200

    table: fix two leaks of a record object
    
    Signed-off-by: Paolo Bonzini <pbonzini redhat com>

 libmsi/table.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libmsi/table.c b/libmsi/table.c
index 5058ad1..895d5e0 100644
--- a/libmsi/table.c
+++ b/libmsi/table.c
@@ -1813,8 +1813,10 @@ static unsigned table_view_remove_column(LibmsiView *view, const char *table, un
     libmsi_record_set_int(rec, 2, number);
 
     r = table_view_create(tv->db, szColumns, &columns);
-    if (r != LIBMSI_RESULT_SUCCESS)
+    if (r != LIBMSI_RESULT_SUCCESS) {
+        g_object_unref(rec);
         return r;
+    }
 
     r = msi_table_find_row((LibmsiTableView *)columns, rec, &row, NULL);
     if (r != LIBMSI_RESULT_SUCCESS)
@@ -1935,8 +1937,10 @@ static unsigned table_view_drop(LibmsiView *view)
     libmsi_record_set_string(rec, 1, tv->name);
 
     r = table_view_create(tv->db, szTables, &tables);
-    if (r != LIBMSI_RESULT_SUCCESS)
+    if (r != LIBMSI_RESULT_SUCCESS) {
+        g_object_unref(rec);
         return r;
+    }
 
     r = msi_table_find_row((LibmsiTableView *)tables, rec, &row, NULL);
     if (r != LIBMSI_RESULT_SUCCESS)


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