[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.main
parent
d0acbe4553
commit
0687c0a4ec
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue