Merge pull request #2022 from profanity-im/fixes

Memory fixes
This commit is contained in:
Michael Vetter
2025-03-13 09:58:09 +01:00
committed by GitHub
7 changed files with 49 additions and 26 deletions

View File

@@ -104,6 +104,14 @@ void auto_free_guchar(guchar** str);
*/
#define auto_guchar __attribute__((__cleanup__(auto_free_guchar)))
#define auto_gfd __attribute__((__cleanup__(auto_close_gfd)))
void auto_close_gfd(gint* fd);
#define auto_FILE __attribute__((__cleanup__(auto_close_FILE)))
void auto_close_FILE(FILE** fd);
#if defined(__OpenBSD__)
#define STR_MAYBE_NULL(p) (p) ?: "(null)"
#else