diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2025-08-31 09:35:02 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2025-08-31 09:35:02 -0700 |
commit | aa2c405f348b07ba2a1c02ca0ca5e2799a6a102e (patch) | |
tree | 6ac412077a3935ea84bba81d90349d2a92fb4ee8 | |
parent | 31b838d61caea9e8b1dd5dcf09c22c4b39131717 (diff) |
Reported by Oracle Parfait 16.2:
Error: Memory leak
Memory leak [memory-leak]:
Memory leak of pointer p allocated with NewQEntry(...)
at line 203 of decode11.c in function 'SequencedReplyExpected'.
malloc called at line 106 in function 'NewQEntry'
Allocated value returned to caller at line 121
p allocated at line 198 in function 'SequencedReplyExpected' with NewQEntry(...)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xscope/-/merge_requests/18>
-rw-r--r-- | decode11.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -194,14 +194,15 @@ SequencedReplyExpected(FD fd, long SequenceNumber, debug(8, (stderr, "Reply expected: sequence %ld and request type %d,%d for fd %d\n", SequenceNumber, RequestType, RequestMinorType, fd)); - /* create a new queue entry */ - p = NewQEntry(SequenceNumber, RequestType, RequestMinorType); /* find the server associated with this client */ fd = FDPair(fd); if (fd < 0 || fd >= MaxFD) return; + /* create a new queue entry */ + p = NewQEntry(SequenceNumber, RequestType, RequestMinorType); + /* attach the new queue entry to the end of the queue for the Server */ if (ReplyQ[fd].Tail != NULL) (ReplyQ[fd].Tail)->Next = p; |