Merge pull request #574 from tobiasjakobi/master

lima + omap: plug the mem leaks that were reported on IRC
This commit is contained in:
Twinaphex 2014-02-24 22:14:26 +01:00
commit 2489e2fef0
2 changed files with 9 additions and 5 deletions

View File

@ -574,7 +574,7 @@ static void *lima_gfx_init(const video_info_t *video, const input_driver_t **inp
vid->rgui_alpha = 1.0f;
lima = calloc(1, sizeof(limare_data_t));
if (!lima) return NULL;
if (!lima) goto fail;
/* Request the Exynos DRM backend for rendering. */
limare_config.type = LIMARE_WINDOWSYS_DRM;

View File

@ -698,6 +698,7 @@ static void omap_gfx_free(void *data) {
if (!vid) return;
omapfb_free(vid->omap);
free(vid->omap);
if (vid->font) vid->font_driver->free(vid->font);
@ -791,17 +792,17 @@ static void *omap_gfx_init(const video_info_t *video, const input_driver_t **inp
if (!vid) return NULL;
vid->omap = calloc(1, sizeof(omapfb_data_t));
if (!vid->omap) return NULL;
if (!vid->omap) goto fail;
vid->bytes_per_pixel = video->rgb32 ? 4 : 2;
if (omapfb_init(vid->omap, vid->bytes_per_pixel) != 0) {
goto fail;
goto fail_omapfb;
}
if (omapfb_backup_state(vid->omap) != 0 ||
omapfb_alloc_mem(vid->omap) != 0 ||
omapfb_mmap(vid->omap) != 0) goto fail;
omapfb_mmap(vid->omap) != 0) goto fail_omapfb;
if (input && input_data) {
*input = NULL;
@ -811,9 +812,12 @@ static void *omap_gfx_init(const video_info_t *video, const input_driver_t **inp
return vid;
fail_omapfb:
omapfb_free(vid->omap);
free(vid->omap);
fail:
free(vid);
RARCH_ERR("video_omap: initialization failed\n");
omap_gfx_free(vid);
return NULL;
}