diff --git a/text_input.c b/text_input.c index 2ed426a..84841ce 100644 --- a/text_input.c +++ b/text_input.c @@ -2222,12 +2222,19 @@ EncodeIMString (const char *input, size_t input_size, int *chars) /* If creating the cd failed, bail out. */ if (cd == (iconv_t) -1) { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif /* Restore the old locale. */ if (!setlocale (LC_CTYPE, oldlocale)) abort (); XLFree (oldlocale); return NULL; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } /* Otherwise, start converting. */ diff --git a/xdata.c b/xdata.c index 3875c82..06e1e5c 100644 --- a/xdata.c +++ b/xdata.c @@ -1691,11 +1691,20 @@ GetConversionCallback (WriteTransfer *transfer, Atom target, Atom *type, cd = iconv_open ("ISO-8859-1", "UTF-8"); +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif + if (cd == (iconv_t) -1) /* The conversion context couldn't be initialized, so fail this transfer. */ return NULL; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + /* First, create a non-blocking pipe. We will give the write end to the client. */ rc = pipe2 (pipe, O_NONBLOCK); @@ -1885,10 +1894,17 @@ PostReceiveConversion (Time time, Atom selection, Atom target, int fd) if (cd == (iconv_t) -1) { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif /* The conversion context couldn't be created. Close the file descriptor and fail. */ close (fd); return; +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } info = XLCalloc (1, sizeof *info);