]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix small memory leak after restore error
authorEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 12:02:51 +0000 (13:02 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 12:02:51 +0000 (13:02 +0100)
bacula/src/dird/ua_restore.c

index 9caab2ee028029e8f26d74fb1eb16e8f009538e0..382b2d338b82f439015d40eca6e12421f30dd39f 100644 (file)
@@ -140,7 +140,7 @@ int restore_cmd(UAContext *ua, const char *cmd)
    strip_prefix = add_prefix = add_suffix = regexp = NULL;
 
    new_rx(&rx);                 /* Initialize RESTORE_CTX */
-   
+
    if (!open_new_client_db(ua)) {
       goto bail_out;
    }
@@ -406,6 +406,9 @@ int restore_cmd(UAContext *ua, const char *cmd)
    rx.component_fname = NULL;
    jcr->component_fd = rx.component_fd;
    rx.component_fd = NULL;
+   if (jcr->bsr_list) {
+      free_bsr(jcr->bsr_list);
+   }
    /* The Client might request the file list */
    jcr->bsr_list = rx.bsr_list;
    rx.bsr_list = NULL;