From: Eric Bollengier Date: Sat, 5 Feb 2011 11:01:07 +0000 (+0100) Subject: Tweak select_media_dbr() X-Git-Tag: Release-7.0.0~1165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=121e2fd367b1132e282980979fe627865c3fb9a3;p=bacula%2Fbacula Tweak select_media_dbr() --- 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);