summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-08-22 21:34:25 -0400
committerRobert Noland <rnoland@2hip.net>2008-08-24 15:25:20 -0400
commit0687c0a4ec78730f752cee04a5b0862f47dbf026 (patch)
treea3b65eacb885a364f8f0e6b8f2f560ca2c391e2e
parentd0acbe4553d27df3fdc217c956c609c54ebb51e6 (diff)
[FreeBSD] Fix long standing memory leak in drm_remove_magic.
We shuffled all the links around to disconnect the entry, but never free it. We would incorrectly free the last entry in the hash chain if nothing matched.
-rw-r--r--bsd-core/drm_auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c
index f3aafe44..60af16cb 100644
--- a/bsd-core/drm_auth.c
+++ b/bsd-core/drm_auth.c
@@ -117,11 +117,11 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
if (prev) {
prev->next = pt->next;
}
+ free(pt, M_DRM);
return 0;
}
}
- free(pt, M_DRM);
return EINVAL;
}