FSAL_GLUSTER: Avoid double free of handle in case of setattr failures

Post any object creation, in case if setting attributes fail, we
seem to be freeing glusterfs handle twice. Fixed the same.

Change-Id: I917f1295a8f29612ccde8081c447135d6abb475c
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
diff --git a/src/FSAL/FSAL_GLUSTER/handle.c b/src/FSAL/FSAL_GLUSTER/handle.c
index 5383523..691b883 100644
--- a/src/FSAL/FSAL_GLUSTER/handle.c
+++ b/src/FSAL/FSAL_GLUSTER/handle.c
@@ -74,6 +74,7 @@
 				"glfs_h_close returned error %s(%d)",
 				strerror(errno), errno);
 		}
+		objhandle->glhandle = NULL;
 	}
 
 	gsh_free(objhandle);
@@ -402,6 +403,8 @@
 				     "setattr2 status=%s",
 				     fsal_err_txt(status));
 			(*handle)->obj_ops.release(*handle);
+			/* We released handle at this point */
+			glhandle = NULL;
 			*handle = NULL;
 		}
 	} else {
@@ -539,6 +542,8 @@
 				     "setattr2 status=%s",
 				     fsal_err_txt(status));
 			(*handle)->obj_ops.release(*handle);
+			/* We released handle at this point */
+			glhandle = NULL;
 			*handle = NULL;
 		}
 	} else {
@@ -644,6 +649,8 @@
 				     "setattr2 status=%s",
 				     fsal_err_txt(status));
 			(*handle)->obj_ops.release(*handle);
+			/* We released handle at this point */
+			glhandle = NULL;
 			*handle = NULL;
 		}
 	} else {
@@ -1614,6 +1621,8 @@
 		if (FSAL_IS_ERROR(status)) {
 			/* Release the handle we just allocated. */
 			(*new_obj)->obj_ops.release(*new_obj);
+			/* We released handle at this point */
+			glhandle = NULL;
 			*new_obj = NULL;
 			goto fileerr;
 		}