summaryrefslogtreecommitdiff
path: root/src/packing
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-02-22 13:08:09 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-02-22 13:08:09 +1100
commitbbc35d4cec38e19fb87c7f76f7a5f1eeb8b4f928 (patch)
tree4192c6df5574a2e02bf7f30ac8df7d19fc009073 /src/packing
parent7afc6b1e88b548a174b06acbbad5c0977304b5ad (diff)
downloadmongo-bbc35d4cec38e19fb87c7f76f7a5f1eeb8b4f928.tar.gz
Fix pack_close: read fields before freeing the struct.
Diffstat (limited to 'src/packing')
-rw-r--r--src/packing/pack_stream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/packing/pack_stream.c b/src/packing/pack_stream.c
index 977f08749bb..ef6aca2402b 100644
--- a/src/packing/pack_stream.c
+++ b/src/packing/pack_stream.c
@@ -58,12 +58,12 @@ wiredtiger_unpack_start(WT_SESSION *wt_session, const char *format, const void *
int
wiredtiger_pack_close(WT_PACK_STREAM *ps, size_t *usedp)
{
- if (ps != NULL)
- __wt_free(ps->pack.session, ps);
-
if (usedp != NULL)
*usedp = WT_PTRDIFF(ps->p, ps->start);
+ if (ps != NULL)
+ __wt_free(ps->pack.session, ps);
+
return (0);
}