From: Marco Eichelberg Date: Thu, 9 Jun 2022 08:03:38 +0000 (+0200) Subject: [PATCH] Fixed memory leak in single process mode. X-Git-Tag: archive/raspbian/3.6.8-6+rpi1~1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d92adf848225308ac06452a4504238f52e159611;p=dcmtk.git [PATCH] Fixed memory leak in single process mode. Fixed a memory leak in dcmqrscp's single process mode. Thanks to for the bug report and test data. Gbp-Pq: Name c34f4e46e672ad21accf04da0dc085e43be6f5e1.patch --- diff --git a/dcmqrdb/libsrc/dcmqrsrv.cc b/dcmqrdb/libsrc/dcmqrsrv.cc index 157e6c02..f5f9df66 100644 --- a/dcmqrdb/libsrc/dcmqrsrv.cc +++ b/dcmqrdb/libsrc/dcmqrsrv.cc @@ -1,6 +1,6 @@ /* * - * Copyright (C) 1993-2021, OFFIS e.V. + * Copyright (C) 1993-2022, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation were developed by @@ -1126,21 +1126,17 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet) #endif } - // cleanup code + // clean-up association OFCondition oldcond = cond; /* store condition flag for later use */ - if (!options_.singleProcess_ && (cond != ASC_SHUTDOWNAPPLICATION)) + cond = ASC_dropAssociation(assoc); + if (cond.bad()) { - /* the child will handle the association, we can drop it */ - cond = ASC_dropAssociation(assoc); - if (cond.bad()) - { - DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond)); - } - cond = ASC_destroyAssociation(&assoc); - if (cond.bad()) - { - DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond)); - } + DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond)); + } + cond = ASC_destroyAssociation(&assoc); + if (cond.bad()) + { + DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond)); } if (oldcond == ASC_SHUTDOWNAPPLICATION) cond = oldcond; /* abort flag is reported to top-level wait loop */