lintian doesn't like orphan packages with uploaders...
[debian/amanda] / server-src / amtrmidx.c
index 2926688850a173f0516ab5a380379ca6e92c06f2..c233743510afc286882373ab655166f992ae1df5 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
  * Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  * All Rights Reserved.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -70,6 +71,11 @@ main(
     int amtrmidx_debug = 0;
     config_overrides_t *cfg_ovr = NULL;
 
+    if (argc > 1 && argv && argv[1] && g_str_equal(argv[1], "--version")) {
+       printf("amtrmidx-%s\n", VERSION);
+       return (0);
+    }
+
     /*
      * Configure program for internationalization:
      *   1) Only set the message locale for now.
@@ -171,6 +177,8 @@ main(
                    strcmp(disk, dp_disk) == 0) {
                    matching_dp = g_slist_append(matching_dp, dp);
                }
+               amfree(dp_host);
+               amfree(dp_disk);
            }
 
            dbprintf("%s %s -> %s\n", diskp->host->hostname,
@@ -182,6 +190,7 @@ main(
                dbprintf(_("could not open index directory %s\n"), qindexdir);
                amfree(indexdir);
                amfree(qindexdir);
+               g_slist_free(matching_dp);
                continue;
            }
            name_length = 100;
@@ -287,6 +296,7 @@ main(
                amfree(datestamp);
                amfree(names[i]);
            }
+           g_slist_free(matching_dp);
            amfree(names);
            amfree(indexdir);
            amfree(qindexdir);