From: Eric Bollengier Date: Sat, 5 Feb 2011 11:01:07 +0000 (+0100) Subject: Tweak select_media_dbr() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f756fa544f54ff65bda69657a1a61daa44206347;p=bacula%2Fbacula Tweak select_media_dbr() --- diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index c17d37f15e..f4a5115a57 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -580,9 +580,10 @@ int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) int select_media_dbr(UAContext *ua, MEDIA_DBR *mr) { int i; - int ret = 0; POOLMEM *err = get_pool_memory(PM_FNAME); + *err=0; + memset(mr, 0, sizeof(MEDIA_DBR)); i = find_arg_with_value(ua, "volume"); @@ -621,7 +622,7 @@ int select_media_dbr(UAContext *ua, MEDIA_DBR *mr) ret = 1; bail_out: - if (*err) { + if (!ret && *err) { ua->error_msg("%s", err); } free_pool_memory(err);