aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/iobuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index 6a9060a0e..1f2cd3f5d 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2237,6 +2237,9 @@ iobuf_copy (iobuf_t dest, iobuf_t source)
assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP);
assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP);
+ if (iobuf_error (dest))
+ return -1;
+
temp = xmalloc (temp_size);
while (1)
{