mirror of
https://github.com/neovim/neovim.git
synced 2026-01-18 02:59:25 +10:00
fix: segfault in ml_recover() if swap file not found
- To reproduce: ":recover non_existent_swapfile"
- Regression: 00f18e2e09
This commit is contained in:
@@ -1244,8 +1244,10 @@ theend:
|
||||
mf_put(mfp, hp, false, false);
|
||||
mf_close(mfp, false); /* will also free(mfp->mf_fname) */
|
||||
}
|
||||
free(buf->b_ml.ml_stack);
|
||||
free(buf);
|
||||
if (buf != NULL) { //may be NULL if swap file not found.
|
||||
free(buf->b_ml.ml_stack);
|
||||
free(buf);
|
||||
}
|
||||
if (serious_error && called_from_main)
|
||||
ml_close(curbuf, TRUE);
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user