Skip to content

Commit

Permalink
Fixed bug 3723 - Possible double free in kmsdrm init code on certain …
Browse files Browse the repository at this point in the history
…errors

Simon Hug

KMSDRM_VideoInit allocates and frees some connectors and encoders but doesn't set the pointer to NULL after freeing. The cleanup code at the end may free one of those garbage pointer should an error happen in the initialization.
  • Loading branch information
slouken committed Aug 11, 2017
1 parent d0b46f1 commit a05522a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -325,6 +325,7 @@ KMSDRM_VideoInit(_THIS)
}

KMSDRM_drmModeFreeConnector(connector);
connector = NULL;
}

if (i == resources->count_connectors) {
Expand All @@ -345,6 +346,7 @@ KMSDRM_VideoInit(_THIS)
}

KMSDRM_drmModeFreeEncoder(encoder);
encoder = NULL;
}

if (i == resources->count_encoders) {
Expand Down

0 comments on commit a05522a

Please sign in to comment.