projects
/
platform
/
upstream
/
flac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b645e31
)
fix memory leaks in array resizers
author
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 29 May 2002 05:56:39 +0000
(
05:56
+0000)
committer
Josh Coalson
<jcoalson@users.sourceforce.net>
Wed, 29 May 2002 05:56:39 +0000
(
05:56
+0000)
src/libFLAC/metadata.c
patch
|
blob
|
history
diff --git
a/src/libFLAC/metadata.c
b/src/libFLAC/metadata.c
index
d55303b
..
a53891c
100644
(file)
--- a/
src/libFLAC/metadata.c
+++ b/
src/libFLAC/metadata.c
@@
-1450,8
+1450,10
@@
FLAC__bool FLAC__metadata_object_seekpoint_array_resize(FLAC__StreamMetaData_See
FLAC__ASSERT(old_num_points > 0);
- if(new_size == 0)
+ if(new_size == 0) {
+ free(*object_array);
*object_array = 0;
+ }
else if(0 == (*object_array = realloc(*object_array, new_size)))
return false;
@@
-1561,8
+1563,10
@@
FLAC__bool FLAC__metadata_object_vorbiscomment_entry_array_resize(FLAC__StreamMe
free((*object_array)[i].entry);
}
- if(new_size == 0)
+ if(new_size == 0) {
+ free(*object_array);
*object_array = 0;
+ }
else if(0 == (*object_array = realloc(*object_array, new_size)))
return false;