diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-05-07 10:11:18 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-05-07 11:21:03 -0700 |
commit | 11384211b9407eeab475e54e4806e47825fb1790 (patch) | |
tree | aafcf800d72023cf7d29efea8628e0b0ac91379b | |
parent | 01c0b0365a50a08e69dffe3c63ac62343560b26c (diff) | |
download | xorg-lib-libXaw-11384211b9407eeab475e54e4806e47825fb1790.tar.gz |
Stop memory leak in GetResourcePixmapPath()
Fixes issue reported by Oracle Parfait static analyzer:
Error: Memory leak
Memory leak [memory-leak] (CWE 401):
Memory leak of pointer pointer allocated with XtMalloc((strlen(value.addr) + 1))
at line 700 of lib/libXaw/src/Pixmap.c in function 'GetResourcePixmapPath'.
pointer allocated at line 679 with XtMalloc((strlen(value.addr) + 1))
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/Pixmap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Pixmap.c b/src/Pixmap.c index 9798c9c..7072eb3 100644 --- a/src/Pixmap.c +++ b/src/Pixmap.c @@ -690,6 +690,7 @@ GetResourcePixmapPath(Display *display) length = (length + (int)strlen(tok) + 3); } } + XtFree(buffer); pixmap_path = XtRealloc(pixmap_path, (Cardinal)((size_t)length + strlen(default_path) + 2)); if (length) pixmap_path[length++] = ':'; |