Skip to content

Commit

Permalink
fix compiler warning about mismatched allocator (#28)
Browse files Browse the repository at this point in the history
The buffer(s) here are created with 'new' but free'd
with 'free' when it should have been 'delete []', resulting
in a compiler warning that may or may not cause issues.

Signed-off-by: Thomas Goodwin <[email protected]>
Co-authored-by: sara boulé <[email protected]>
  • Loading branch information
btgoodwin and saraboule authored Feb 23, 2024
1 parent 337280d commit fe412dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gsts3uploaderpartcache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class UploaderPartCache {

void clear_buffer() {
if (_buffer) {
free(_buffer);
delete [] _buffer;
}
_buffer = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/check/uploaderpartcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using gst::aws::s3::UploaderPartCache;

#define TEST_BUFFER_NEW(s) (new char[s])
#define TEST_BUFFER_FREE(b) {if (b) free(b); b = NULL;}
#define TEST_BUFFER_FREE(b) {if (b) delete [] b; b = NULL;}

GST_START_TEST(test_part_info) {
UploaderPartCache::PartInfo uut;
Expand Down

0 comments on commit fe412dd

Please sign in to comment.