Bug 1263872 - prevent memory leak by closing |file|. r?cpearce draft
authorAndi-Bogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 12 Apr 2016 13:33:37 +0300
changeset 349820 ed3c80d64fa6b8192048a4c53fb2d5b8277f6e3e
parent 349571 21bf1af375c1fa8565ae3bb2e89bd1a0809363d4
child 518193 13e590591c0f20a93b547a8614b65a0f321369dc
push id15186
push userBogdan.Postelnicu@softvision.ro
push dateTue, 12 Apr 2016 10:34:54 +0000
reviewerscpearce
bugs1263872
milestone48.0a1
Bug 1263872 - prevent memory leak by closing |file|. r?cpearce MozReview-Commit-ID: O4tI7EqWVU
media/libcubeb/tests/test_resampler.cpp
--- a/media/libcubeb/tests/test_resampler.cpp
+++ b/media/libcubeb/tests/test_resampler.cpp
@@ -86,20 +86,19 @@ void dump(const char * name, T * frames,
   FILE * file;
   fopen_portable(&file, name, "wb");
 
   if (!file) {
     fprintf(stderr, "error opening %s\n", name);
     return;
   }
 
-  if (count != fwrite(frames, sizeof(T), count, file)) {
+  if (count != fwrite(frames, sizeof(T), count, file))
     fprintf(stderr, "error writing to %s\n", name);
-    return;
-  }
+ 
   fclose(file);
 }
 #else
 template<typename T>
 void dump(const char * name, T * frames, size_t count)
 { }
 #endif