summaryrefslogtreecommitdiff
path: root/usr.bin/mg/undo.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mg/undo.c')
-rw-r--r--usr.bin/mg/undo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c
index 0976713ef2c..f95da63e951 100644
--- a/usr.bin/mg/undo.c
+++ b/usr.bin/mg/undo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undo.c,v 1.53 2013/03/25 11:39:38 florian Exp $ */
+/* $OpenBSD: undo.c,v 1.54 2013/06/01 16:27:56 lum Exp $ */
/*
* This file is in the public domain
*/
@@ -390,7 +390,8 @@ undo_dump(int f, int n)
return (FALSE);
bp->b_flag |= BFREADONLY;
bclear(bp);
- popbuf(bp, WNONE);
+ if ((wp = popbuf(bp, WNONE)) == NULL)
+ return (FALSE);
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
if (wp->w_bufp == bp) {