]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/guid_to_name.c
Tweak version date
[bacula/bacula] / bacula / src / lib / guid_to_name.c
index f5415f3f0209581ac51e266334234d129b527cd7..dd458e2aea809d7b06e4b78a5b470fa2d7a91f7c 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007 Kern Sibbald
+   Copyright (C) 2007-2011 Kern Sibbald
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation, which is 
    listed in the file LICENSE.
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -31,7 +31,6 @@
  *  Program to convert uid and gid into names, and cache the results
  *   for preformance reasons.
  *
- *  Version $Id$
  */
 
 #include "bacula.h"
@@ -147,6 +146,7 @@ char *guid_list::uid_to_name(uid_t uid, char *name, int maxlen)
       }
       fitem = (guitem *)uid_list->binary_insert(item, uid_compare);
       if (fitem != item) {               /* item already there this shouldn't happen */
+         free(item->name);
          free(item);
          item = fitem;   
       }
@@ -161,7 +161,7 @@ char *guid_list::gid_to_name(gid_t gid, char *name, int maxlen)
    sitem.gid = gid;
    char buf[50];
 
-   item = (guitem *)uid_list->binary_search(&sitem, gid_compare);
+   item = (guitem *)gid_list->binary_search(&sitem, gid_compare);
    if (!item) {
       item = (guitem *)malloc(sizeof(guitem));
       item->gid = gid;
@@ -172,6 +172,7 @@ char *guid_list::gid_to_name(gid_t gid, char *name, int maxlen)
       }
       fitem = (guitem *)gid_list->binary_insert(item, gid_compare);
       if (fitem != item) {               /* item already there this shouldn't happen */
+         free(item->name);
          free(item);
          item = fitem;   
       }
@@ -197,7 +198,7 @@ int main()
    }
     
    free_guid_list(list);
-   sm_dump(false);
+   sm_dump(false);     /* unit test */
 
    return 0;
 }