From dfa31a2b110abd8c5515fcebf0b57aa6b63b7a08 Mon Sep 17 00:00:00 2001 From: lum Date: Sat, 1 Jun 2013 16:27:57 +0000 Subject: If popbuf() fails, calling function should return FALSE. --- usr.bin/mg/undo.c | 5 +++-- 1 file 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) { -- cgit v1.2.3