From b4aeaa30a1ee5a95cbb498f434af2f8e3669bbdf Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Mon, 22 Nov 2021 11:20:52 +0100
Subject: [PATCH] Use SDL_calloc / SDL_free
---
src/video/x11/SDL_x11modes.c | 2 +-
src/video/x11/edid-parse.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c
index cbc3242be5..a6bbfde57d 100644
--- a/src/video/x11/SDL_x11modes.c
+++ b/src/video/x11/SDL_x11modes.c
@@ -322,7 +322,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen,
dump_monitor_info(info);
#endif
SDL_strlcpy(name, info->dsc_product_name, namelen);
- free(info);
+ SDL_free(info);
}
X11_XFree(prop);
}
diff --git a/src/video/x11/edid-parse.c b/src/video/x11/edid-parse.c
index f1ef08965d..af80edd4af 100644
--- a/src/video/x11/edid-parse.c
+++ b/src/video/x11/edid-parse.c
@@ -522,7 +522,7 @@ decode_check_sum (const uchar *edid,
MonitorInfo *
decode_edid (const uchar *edid)
{
- MonitorInfo *info = calloc (1, sizeof (MonitorInfo));
+ MonitorInfo *info = SDL_calloc (1, sizeof (MonitorInfo));
decode_check_sum (edid, info);
@@ -534,8 +534,8 @@ decode_edid (const uchar *edid)
!decode_established_timings (edid, info) ||
!decode_standard_timings (edid, info) ||
!decode_descriptors (edid, info)) {
- free(info);
- return NULL;
+ SDL_free(info);
+ return NULL;
}
return info;