diff options
author | 2013-06-01 16:27:56 +0000 | |
---|---|---|
committer | 2013-06-01 16:27:56 +0000 | |
commit | 330e207744218d10843aaa9361b9825cd97a9e30 (patch) | |
tree | 0cc2b1bf50f68d24f0dce2bb5f6bce9cf7e3c7d8 | |
parent | regen (diff) | |
download | wireguard-openbsd-330e207744218d10843aaa9361b9825cd97a9e30.tar.xz wireguard-openbsd-330e207744218d10843aaa9361b9825cd97a9e30.zip |
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) { |