libFLAC/metadata_object.c: Assign NULL after free()
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 6 Jul 2015 11:30:55 +0000 (21:30 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 6 Jul 2015 11:30:58 +0000 (21:30 +1000)
Patch-from: lvqcl <lvqcl.mail@gmail.com>

src/libFLAC/metadata_object.c

index 82abe41..909dab5 100644 (file)
@@ -655,12 +655,16 @@ void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object)
                        if(0 != object->data.vorbis_comment.comments) {
                                FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0);
                                vorbiscomment_entry_array_delete_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
+                               object->data.vorbis_comment.comments = 0;
+                               object->data.vorbis_comment.num_comments = 0;
                        }
                        break;
                case FLAC__METADATA_TYPE_CUESHEET:
                        if(0 != object->data.cue_sheet.tracks) {
                                FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0);
                                cuesheet_track_array_delete_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks);
+                               object->data.cue_sheet.tracks = 0;
+                               object->data.cue_sheet.num_tracks = 0;
                        }
                        break;
                case FLAC__METADATA_TYPE_PICTURE: