video_out.c: Fix a minor memory leak
commit59ffaa41f0390914584f44293d5aed0a34e85b87
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Fri, 8 May 2009 23:37:35 +0000 (9 02:37 +0300)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Fri, 8 May 2009 23:44:08 +0000 (9 02:44 +0300)
treea83ff84ebc0a4788b7b46e9b51e7ec296c368cba
parent1db1773ec27fc4e7c9d44ad02ccfa7eaf364ce07
video_out.c: Fix a minor memory leak

The code that loops over possible video output drivers and tries to
find a working one does not free and reallocate the 'struct vo' if a
driver's preinit() call fails, but just overwrites the same struct
instead. This means that any memory the failing driver allocated as a
talloc subcontext will not be freed immediately. This is not even a
real leak as the memory will be freed once the VO is closed, but it's
still nicer to free things immediately. Add talloc_free_children() to
free any such talloc subcontexts that were created during the failing
preinit().
libvo/video_out.c