git » libjio » commit d1e28a7

jtrans_rollback(): Handle jtrans_new() failures

author Alberto Bertogli
2009-08-02 07:57:32 UTC
committer Alberto Bertogli
2009-08-02 08:00:19 UTC
parent 1478b52c9271ca42a97c00aeb718d2a5f786bc41

jtrans_rollback(): Handle jtrans_new() failures

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/trans.c +3 -0

diff --git a/libjio/trans.c b/libjio/trans.c
index 2d196c7..16ca3d6 100644
--- a/libjio/trans.c
+++ b/libjio/trans.c
@@ -400,6 +400,9 @@ ssize_t jtrans_rollback(struct jtrans *ts)
 	struct operation *op, *curop, *lop;
 
 	newts = jtrans_new(ts->fs, 0);
+	if (newts == NULL)
+		return -1;
+
 	newts->flags = ts->flags;
 	newts->numops = ts->numops;