Use SDL_calloc / SDL_free
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c
index cbc3242..a6bbfde 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 f1ef089..af80edd 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;