From f756fa544f54ff65bda69657a1a61daa44206347 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 5 Feb 2011 12:01:07 +0100 Subject: [PATCH] Tweak select_media_dbr() --- bacula/src/dird/ua_select.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.39.5