add a changelog entry
[debian/amanda] / client-src / sendsize.c
index 3c2815a89100fce4e47fde302858b0f05b9c4374..6d9f0c28f0bf83c7b1ba57f15dbb44ece9ecf566 100644 (file)
@@ -122,6 +122,7 @@ main(
     disk_estimates_t *est;
     disk_estimates_t *est1;
     disk_estimates_t *est_prev;
+    disk_estimates_t *est_next;
     char *line = NULL;
     char *s, *fp;
     int ch;
@@ -413,6 +414,20 @@ main(
        amandates_started = FALSE;
     }
 
+    est_prev = NULL;
+    for(est = est_list; est != NULL; est = est_next) {
+       int good = merge_dles_properties(est->dle, 0);
+       est_next = est->next;
+       if (!good) {
+           if (est == est_list) {
+               est_list = est_next;
+           } else {
+               est_prev->next = est_next;
+           }
+       } else {
+           est_prev = est;
+       }
+    }
     for(est = est_list; est != NULL; est = est->next) {
        run_client_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE, g_options, est->dle,
                           stdout);
@@ -693,8 +708,8 @@ free_estimates(
     amfree(est->qamdevice);
     amfree(est->dirname);
     amfree(est->qdirname);
-    if(est->dle) {
-/* free DLE */
+    if (est->dle) {
+       free_dle(est->dle);
     }
 }
 
@@ -864,11 +879,13 @@ application_api_calc_estimate(
     if (est->dle->data_path == DATA_PATH_AMANDA &&
        (bsu->data_path_set & DATA_PATH_AMANDA)==0) {
        g_printf("%s %d ERROR application %s doesn't support amanda data-path\n", est->qamname, 0, est->dle->program);
+       amfree(bsu);
        return;
     }
     if (est->dle->data_path == DATA_PATH_DIRECTTCP &&
        (bsu->data_path_set & DATA_PATH_DIRECTTCP)==0) {
        g_printf("%s %d ERROR application %s doesn't support directtcp data-path\n", est->qamname, 0, est->dle->program);
+       amfree(bsu);
        return;
     }
 
@@ -943,8 +960,10 @@ application_api_calc_estimate(
        }
     }
 
-    if (nb_level == 0)
+    if (nb_level == 0) {
+       amfree(bsu);
        return;
+    }
 
     if (bsu->multi_estimate) {
        for (i=0;i<nb_level;i++) {
@@ -964,6 +983,8 @@ application_api_calc_estimate(
            }
        }
     }
+
+    amfree(bsu);
 }