diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2006-03-10 02:29:03 +0000 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2006-03-10 02:29:03 +0000 |
commit | 84c007b426d321786f9aec1d9fda14b5baa35561 (patch) | |
tree | d080632b5260403112b6706f3998ff4ca556f104 | |
parent | 61e237eec7193701ce1236e67ebdfe7465b5db8a (diff) |
Coverity nos. 868 and 869: Free the result of xf86GetEntityInfo.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/nv_driver.c | 14 | ||||
-rw-r--r-- | src/riva_driver.c | 12 |
3 files changed, 27 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2006-03-09 Aaron Plattner <aplattner@nvidia.com> + + * src/nv_driver.c: (NVPreInit): + * src/riva_driver.c: (RivaPreInit): + Coverity nos. 868 and 869: Free the result of xf86GetEntityInfo. + 2006-01-24 Aaron Plattner <aplattner@nvidia.com> * src/nv_driver.c: diff --git a/src/nv_driver.c b/src/nv_driver.c index 35c4115..5e30162 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1,4 +1,4 @@ -/* $XdotOrg: driver/xf86-video-nv/src/nv_driver.c,v 1.20 2006/01/23 00:04:41 aplattner Exp $ */ +/* $XdotOrg: driver/xf86-video-nv/src/nv_driver.c,v 1.21 2006/01/24 16:45:29 aplattner Exp $ */ /* $XConsortium: nv_driver.c /main/3 1996/10/28 05:13:37 kaleb $ */ /* * Copyright 1996-1997 David J. McKay @@ -983,8 +983,16 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) const char *s; if (flags & PROBE_DETECT) { - nvProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); - return TRUE; + EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + + if (!pEnt) + return FALSE; + + i = pEnt->index; + xfree(pEnt); + + nvProbeDDC(pScrn, i); + return TRUE; } /* diff --git a/src/riva_driver.c b/src/riva_driver.c index 968ef47..c5e6ea0 100644 --- a/src/riva_driver.c +++ b/src/riva_driver.c @@ -493,8 +493,16 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags) const char *s; if (flags & PROBE_DETECT) { - rivaProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); - return TRUE; + EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + + if (!pEnt) + return FALSE; + + i = pEnt->index; + xfree(pEnt); + + rivaProbeDDC(pScrn, i); + return TRUE; } /* |