Author: pschweitzer
Date: Sat Nov 12 09:24:09 2016
New Revision: 73208

URL: http://svn.reactos.org/svn/reactos?rev=73208&view=rev
Log:
[SNDREC32]
Don't double free buffers in case of failure

Modified:
    trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp

Modified: trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp?rev=73208&r1=73207&r2=73208&view=diff
==============================================================================
--- trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp    
[iso-8859-1] (original)
+++ trunk/reactos/base/applications/sndrec32/audio_resampler_acm.cpp    
[iso-8859-1] Sat Nov 12 09:24:09 2016
@@ -126,10 +126,16 @@
             {
                 /* Free buffer memory */
                 if (acm_header.pbSrc != 0)
+                {
                     delete[] acm_header.pbSrc;
+                    acm_header.pbSrc = 0;
+                }
 
                 if (acm_header.pbDst != 0)
+                {
                     delete[] acm_header.pbDst;
+                    acm_header.pbDst = 0;
+                }
 
                 /* Re-init structures */
                 init_();
@@ -147,10 +153,16 @@
         {
             /* Free buffer memory */
             if (acm_header.pbSrc != 0)
+            {
                 delete[] acm_header.pbSrc;
+                acm_header.pbSrc = 0;
+            }
 
             if (acm_header.pbDst != 0)
+            {
                 delete[] acm_header.pbDst;
+                acm_header.pbDst = 0;
+            }
 
             /* Re-init structures */
             init_();


Reply via email to