# SDL: QNX: use SDL\_malloc

**URL:** <https://discourse.libsdl.org/t/sdl-qnx-use-sdl-malloc/33636>\
**Category:** SDL Commits\
**Created:** [November 22, 2021, 4:41pm UTC](https://discourse.libsdl.org/t/sdl-qnx-use-sdl-malloc/33636 "2021-11-22T16:41:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [November 22, 2021, 4:41pm UTC](https://discourse.libsdl.org/t/sdl-qnx-use-sdl-malloc/33636/1 "2021-11-22T16:41:50Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/10ffcbb115ac3c34d2c7135a0ab755b25d672657>

```diff
From 10ffcbb115ac3c34d2c7135a0ab755b25d672657 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Mon, 22 Nov 2021 16:41:45 +0100
Subject: [PATCH] QNX: use SDL_malloc

---
 src/video/qnx/gl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/video/qnx/gl.c b/src/video/qnx/gl.c
index 19e1bd4f710..1862ab425f5 100644
--- a/src/video/qnx/gl.c
+++ b/src/video/qnx/gl.c
@@ -85,7 +85,7 @@ glGetConfig(EGLConfig *pconf, int *pformat)
     }
 
     // Allocate enough memory for all configurations.
- egl_configs = malloc(egl_num_configs * sizeof(*egl_configs));
+ egl_configs = SDL_malloc(egl_num_configs * sizeof(*egl_configs));
     if (egl_configs == NULL) {
         return -1;
     }
@@ -94,7 +94,7 @@ glGetConfig(EGLConfig *pconf, int *pformat)
     rc = eglGetConfigs(egl_disp, egl_configs, egl_num_configs,
                        &egl_num_configs);
     if (rc != EGL_TRUE) {
- free(egl_configs);
+ SDL_free(egl_configs);
         return -1;
     }
 
@@ -119,7 +119,7 @@ glGetConfig(EGLConfig *pconf, int *pformat)
         break;
     }
 
- free(egl_configs);
+ SDL_free(egl_configs);
     *pconf = egl_conf;
     *pformat = chooseFormat(egl_conf);
 

```
