1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Check and free the actual pointer the was used in a malloc instead of

checking and freeing a different pointer that may or may not have been
assigned the same value.  This should fix panics under load that were
recently reported.
This commit is contained in:
Scott Long 2004-03-01 21:27:14 +00:00
parent 6b40af88db
commit d488190531
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126461

View File

@ -1554,8 +1554,8 @@ mlx_enquire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)
if ((mc->mc_complete == NULL) && (mc != NULL))
mlx_releasecmd(mc);
/* we got an error, and we allocated a result */
if ((error != 0) && (mc->mc_data != NULL)) {
free(mc->mc_data, M_DEVBUF);
if ((error != 0) && (result != NULL)) {
free(result, M_DEVBUF);
mc->mc_data = NULL;
}
return(result);