]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix possible seg fault in SD when freeing a volume entry.
authorKern Sibbald <kern@sibbald.com>
Fri, 4 Apr 2008 11:53:00 +0000 (11:53 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 4 Apr 2008 11:53:00 +0000 (11:53 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6742 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/protos.h
bacula/src/stored/reserve.c
bacula/src/version.h

index 616c1d9c8dc5cab2d9edb8397087ba885ab4a25f..b6aca7b9ff63a1b065e8c964833ae7fff5cd96aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -68,6 +68,7 @@ bool     init_autochangers();
 int      autoload_device(DCR *dcr, int writing, BSOCK *dir);
 bool     autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd);
 bool     unload_autochanger(DCR *dcr, int loaded);
+bool     unload_dev(DCR *dcr, DEVICE *dev);
 char    *edit_device_codes(DCR *dcr, char *omsg, const char *imsg, const char *cmd);
 int      get_autochanger_loaded_slot(DCR *dcr);
 
index 131ddd12bae4d39ed3b7fa25d22fb176280ed3d9..51502c0d248455035fc1201d6b27459669247182 100644 (file)
@@ -241,14 +241,18 @@ static VOLRES *new_vol_item(DCR *dcr, const char *VolumeName)
 
 static void free_vol_item(VOLRES *vol)
 {
+   DEVICE *dev = NULL;
+
    free(vol->vol_name);
    if (vol->dev) {
-      vol->dev->vol = NULL;
+      dev = vol->dev;
    }
    free(vol);
+   if (dev) {
+      dev->vol = NULL;
+   }
 }
 
-
 /*
  * Put a new Volume entry in the Volume list. This
  *  effectively reserves the volume so that it will
index f0bbd2f44c7346caff7781b26375ab5167158469..e30b7c1746b5db8c99260ea1ab045402c32459d5 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.2.9-b5"
-#define BDATE   "02 April 2008"
-#define LSMDATE "02Apr08"
+#define BDATE   "04 April 2008"
+#define LSMDATE "04Apr08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */