From: Robert Noland Date: Sat, 23 Aug 2008 01:34:25 +0000 (-0400) Subject: [FreeBSD] Fix long standing memory leak in drm_remove_magic. X-Git-Tag: libdrm-2.4.0~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0687c0a4ec78730f752cee04a5b0862f47dbf026;p=platform%2Fupstream%2Flibdrm.git [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. --- diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index f3aafe4..60af16c 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; }