qt-faststart: Avoid leaking memory if encountering a file with double ftyp atoms
authorMartin Storsjö <martin@martin.st>
Sun, 9 May 2010 17:46:42 +0000 (17:46 +0000)
committerMartin Storsjö <martin@martin.st>
Sun, 9 May 2010 17:46:42 +0000 (17:46 +0000)
Originally committed as revision 23065 to svn://svn.ffmpeg.org/ffmpeg/trunk

tools/qt-faststart.c

index bcd5e478a6f7d10e6ffbf02dd7a8111dc847f6e3..f48ffc0b5d713b6deb1babd698f8a180a30d8604 100644 (file)
@@ -116,6 +116,7 @@ int main(int argc, char *argv[])
         /* keep ftyp atom */
         if (atom_type == FTYP_ATOM) {
             ftyp_atom_size = atom_size;
+            free(ftyp_atom);
             ftyp_atom = malloc(ftyp_atom_size);
             if (!ftyp_atom) {
                 printf ("could not allocate %"PRIu64" byte for ftyp atom\n",