summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-05-04 15:13:28 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-05-04 15:13:28 +0000
commit4779f2f50e6288e9cdc221c4e6f44ff97325544d (patch)
treec20f6af0567bacd7cd51a76484996a9886e3da38
parent778bec878eb6ffddc80cc61b46d1d5d1752f8f1e (diff)
fixed memory leak problem in drm_remove_magic()
-rw-r--r--linux/auth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/auth.c b/linux/auth.c
index 0e3b1c56..b8ffaede 100644
--- a/linux/auth.c
+++ b/linux/auth.c
@@ -103,13 +103,14 @@ int drm_remove_magic(drm_device_t *dev, drm_magic_t magic)
prev->next = pt->next;
}
up(&dev->struct_sem);
+ drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
return 0;
}
}
up(&dev->struct_sem);
- drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
-
+ /* pt is NULL / magic not found */
+
return -EINVAL;
}