diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-03-19 22:19:58 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-03-26 14:36:47 -0700 |
commit | 1676e4331fb0217a8e4fb25badf56a7b276d609b (patch) | |
tree | f69a251b2520a283ad8de1a149062e5926875e8c | |
parent | 579715f830fbbca9e1ecb17dc18176132f5969e7 (diff) |
dix: Fix a small potential memory leak in ProcRotateProperties. (#25216)
Slightly better version; xfree is safe to call with potential NULL pointers.
2nd version: Use all spaces and redent surrounding lines.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | dix/property.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dix/property.c b/dix/property.c index 9ec5dc6ae..e4073c592 100644 --- a/dix/property.c +++ b/dix/property.c @@ -140,8 +140,10 @@ ProcRotateProperties(ClientPtr client) props = xalloc(stuff->nAtoms * sizeof(PropertyPtr)); saved = xalloc(stuff->nAtoms * sizeof(PropertyRec)); if (!props || !saved) { - rc = BadAlloc; - goto out; + xfree(props); + xfree(saved); + rc = BadAlloc; + goto out; } for (i = 0; i < stuff->nAtoms; i++) |