From: Michal Rakowski Date: Thu, 5 Nov 2020 12:57:21 +0000 (+0100) Subject: Add missing jcr's reference counter decrement in bscan. X-Git-Tag: Release-11.3.2~861 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64be7335299c53e826d128c236a471e6b5d9bf17;p=thirdparty%2Fbacula.git Add missing jcr's reference counter decrement in bscan. Without it, jcr was not freed at all and the the 'bscan_free_jcr' couldn't be called. There is probably more work around that, since each 'get_jcr_by_session' call increases reference counter and it's not always decreased after that. --- diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index 5d5857829..10157b892 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -655,6 +655,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) create_jobmedia_record(db, mjcr); } free_dcr(mjcr->read_dcr); + mjcr->dec_use_count(); /* Decrease reference counter increased by get_jcr_by_session call */ free_jcr(mjcr); break;