From 121e2fd367b1132e282980979fe627865c3fb9a3 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 6f66b170bd..2ada78ad19 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -598,9 +598,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"); @@ -639,7 +640,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