]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/alist.c
Use the command line utility dropdb instead of the psql command
[bacula/bacula] / bacula / src / lib / alist.c
index e5eafaf93384b43ca7b20b909f50d1a74ed6741b..b9425c61143b3e3080ee7b5bd88c82912ca659b7 100644 (file)
@@ -62,8 +62,10 @@ void * alist::get(int index)
 void alist::destroy()
 {
    if (items) {
-      for (int i=0; i<num_items; i++) {
-        free(items[i]);
+      if (own_items) {
+        for (int i=0; i<num_items; i++) {
+           free(items[i]);
+        }
       }
       free(items);
    }
@@ -92,7 +94,7 @@ int main()
       sprintf(buf, "This is item %d", i);
       fileset->mylist.append(bstrdup(buf));
    } 
-   for (int i=0; i<fileset->mylist.size(); i++) {
+   for (int i=0; i< fileset->mylist.size(); i++) {
       printf("Item %d = %s\n", i, (char *)fileset->mylist[i]);  
    }
    fileset->mylist.destroy();
@@ -105,7 +107,7 @@ int main()
       sprintf(buf, "This is item %d", i);
       mlist->append(bstrdup(buf));
    } 
-   for (int i=0; i<mlist->size(); i++) {
+   for (int i=0; i< mlist->size(); i++) {
       printf("Item %d = %s\n", i, (char *)mlist->get(i));  
    }