[SNDREC32]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 12 Nov 2016 09:24:09 +0000 (09:24 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 12 Nov 2016 09:24:09 +0000 (09:24 +0000)
Don't double free buffers in case of failure

svn path=/trunk/; revision=73208

reactos/base/applications/sndrec32/audio_resampler_acm.cpp

index 443a468..ddca7db 100644 (file)
@@ -126,10 +126,16 @@ audio_resampler_acm::close(void)
             {
                 /* 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 @@ audio_resampler_acm::close(void)
         {
             /* 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_();