Use SDL_calloc / SDL_free

This commit is contained in:
Sylvain 2021-11-22 11:20:52 +01:00 committed by Sam Lantinga
parent cb9f85e8d0
commit b4aeaa30a1
2 changed files with 4 additions and 4 deletions

View File

@ -322,7 +322,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen,
dump_monitor_info(info); dump_monitor_info(info);
#endif #endif
SDL_strlcpy(name, info->dsc_product_name, namelen); SDL_strlcpy(name, info->dsc_product_name, namelen);
free(info); SDL_free(info);
} }
X11_XFree(prop); X11_XFree(prop);
} }

View File

@ -522,7 +522,7 @@ decode_check_sum (const uchar *edid,
MonitorInfo * MonitorInfo *
decode_edid (const uchar *edid) decode_edid (const uchar *edid)
{ {
MonitorInfo *info = calloc (1, sizeof (MonitorInfo)); MonitorInfo *info = SDL_calloc (1, sizeof (MonitorInfo));
decode_check_sum (edid, info); decode_check_sum (edid, info);
@ -534,8 +534,8 @@ decode_edid (const uchar *edid)
!decode_established_timings (edid, info) || !decode_established_timings (edid, info) ||
!decode_standard_timings (edid, info) || !decode_standard_timings (edid, info) ||
!decode_descriptors (edid, info)) { !decode_descriptors (edid, info)) {
free(info); SDL_free(info);
return NULL; return NULL;
} }
return info; return info;