diff options
author | lum <lum@cvs.openbsd.org> | 2013-06-01 16:27:57 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2013-06-01 16:27:57 +0000 |
commit | dfa31a2b110abd8c5515fcebf0b57aa6b63b7a08 (patch) | |
tree | df9eab7d991e5095ddb62b29e3c45f668c25b505 | |
parent | abb7ffab3024acdc0e3af0ba514293a807c66a7c (diff) |
If popbuf() fails, calling function should return FALSE.
-rw-r--r-- | usr.bin/mg/undo.c | 5 |
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) { |