summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2006-09-18 16:29:46 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2006-09-18 16:29:46 -0700
commitdd25684d6f67b8c5a836b98d224ac6bf21076972 (patch)
treefd61f0016e80e4a3b9a91739e921f8f578a6c943
parent8681d431516979dcffd1ca7a65d47026d8ad0336 (diff)
downloadxorg-lib-libXv-dd25684d6f67b8c5a836b98d224ac6bf21076972.tar.gz
Coverity CID #580: XvQueryEncodings Returned without freeing storage "pes"
Free the portion of the encoding list we had already filled in if we get an error allocating memory for a list entry.
-rw-r--r--src/Xv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Xv.c b/src/Xv.c
index d92bd71..3c999a1 100644
--- a/src/Xv.c
+++ b/src/Xv.c
@@ -381,6 +381,7 @@ XvQueryEncodings(
u.buffer += (sz_xvEncodingInfo + 3) & ~3;
if ( (name = (char *)Xmalloc(size+1)) == NULL) {
+ XvFreeEncodingInfo(pes);
Xfree(buffer);
UnlockDisplay(dpy);
SyncHandle();