Mercurial > vim
comparison src/misc2.c @ 14954:69d2749a6a2f v8.1.0488
patch 8.1.0488: using freed memory in quickfix code
commit https://github.com/vim/vim/commit/9f84ded38b62c82a4ee57b54f403b1b185ed8170
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 20 20:54:02 2018 +0200
patch 8.1.0488: using freed memory in quickfix code
Problem: Using freed memory in quickfix code. (Dominique Pelle)
Solution: Add the quickfix_busy() flag to postpone deleting quickfix lists
until it is safe. (Yegappan Lakshmanan, closes #3538)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Oct 2018 21:00:06 +0200 |
parents | c1e94bb0f004 |
children | c338c91086b9 |
comparison
equal
deleted
inserted
replaced
14953:fde12f88d9cc | 14954:69d2749a6a2f |
---|---|
1229 buf = nextbuf; /* didn't work, try next one */ | 1229 buf = nextbuf; /* didn't work, try next one */ |
1230 else | 1230 else |
1231 buf = firstbuf; | 1231 buf = firstbuf; |
1232 } | 1232 } |
1233 | 1233 |
1234 #ifdef FEAT_ARABIC | 1234 # ifdef FEAT_ARABIC |
1235 free_cmdline_buf(); | 1235 free_cmdline_buf(); |
1236 #endif | 1236 # endif |
1237 | 1237 |
1238 /* Clear registers. */ | 1238 /* Clear registers. */ |
1239 clear_registers(); | 1239 clear_registers(); |
1240 ResetRedobuff(); | 1240 ResetRedobuff(); |
1241 ResetRedobuff(); | 1241 ResetRedobuff(); |
1242 | 1242 |
1243 #if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) | 1243 # if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) |
1244 vim_free(serverDelayedStartName); | 1244 vim_free(serverDelayedStartName); |
1245 #endif | 1245 # endif |
1246 | 1246 |
1247 /* highlight info */ | 1247 /* highlight info */ |
1248 free_highlight(); | 1248 free_highlight(); |
1249 | 1249 |
1250 reset_last_sourcing(); | 1250 reset_last_sourcing(); |
1263 break; | 1263 break; |
1264 | 1264 |
1265 # ifdef FEAT_JOB_CHANNEL | 1265 # ifdef FEAT_JOB_CHANNEL |
1266 channel_free_all(); | 1266 channel_free_all(); |
1267 # endif | 1267 # endif |
1268 #ifdef FEAT_TIMERS | 1268 # ifdef FEAT_TIMERS |
1269 timer_free_all(); | 1269 timer_free_all(); |
1270 #endif | 1270 # endif |
1271 # ifdef FEAT_EVAL | 1271 # ifdef FEAT_EVAL |
1272 /* must be after channel_free_all() with unrefs partials */ | 1272 /* must be after channel_free_all() with unrefs partials */ |
1273 eval_clear(); | 1273 eval_clear(); |
1274 # endif | 1274 # endif |
1275 # ifdef FEAT_JOB_CHANNEL | 1275 # ifdef FEAT_JOB_CHANNEL |
1280 free_termoptions(); | 1280 free_termoptions(); |
1281 | 1281 |
1282 /* screenlines (can't display anything now!) */ | 1282 /* screenlines (can't display anything now!) */ |
1283 free_screenlines(); | 1283 free_screenlines(); |
1284 | 1284 |
1285 #if defined(USE_XSMP) | 1285 # if defined(USE_XSMP) |
1286 xsmp_close(); | 1286 xsmp_close(); |
1287 #endif | 1287 # endif |
1288 #ifdef FEAT_GUI_GTK | 1288 # ifdef FEAT_GUI_GTK |
1289 gui_mch_free_all(); | 1289 gui_mch_free_all(); |
1290 #endif | 1290 # endif |
1291 clear_hl_tables(); | 1291 clear_hl_tables(); |
1292 | 1292 |
1293 vim_free(IObuff); | 1293 vim_free(IObuff); |
1294 vim_free(NameBuff); | 1294 vim_free(NameBuff); |
1295 # ifdef FEAT_QUICKFIX | |
1296 check_quickfix_busy(); | |
1297 # endif | |
1295 } | 1298 } |
1296 #endif | 1299 #endif |
1297 | 1300 |
1298 /* | 1301 /* |
1299 * Copy "string" into newly allocated memory. | 1302 * Copy "string" into newly allocated memory. |