Tests: Fix use-after-free in fst testcases (#2709)

This commit is contained in:
Yutetsu TAKATSUKASA 2020-12-17 00:00:13 +09:00 committed by GitHub
parent 3039735648
commit f98782c061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1816,10 +1816,11 @@ free(xc->curval_mem);
free(xc->valpos_mem);
free(xc->vchg_mem);
tmpfile_close(&xc->tchn_handle, &xc->tchn_handle_nam);
fstWriterContext* const parent = xc->xc_parent;
free(xc);
xc->xc_parent->in_pthread = 0;
pthread_mutex_unlock(&(xc->xc_parent->mutex));
parent->in_pthread = 0;
pthread_mutex_unlock(&(parent->mutex));
return(NULL);
}