changeset 4113:770c06dc9adb HEAD

Added some t_push/t_pop calls
author Timo Sirainen <tss@iki.fi>
date Sat, 01 Apr 2006 00:19:20 +0300
parents d7e169797e3e
children d1c27abc6ebc
files src/lib/file-dotlock.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/file-dotlock.c	Sat Apr 01 00:19:05 2006 +0300
+++ b/src/lib/file-dotlock.c	Sat Apr 01 00:19:20 2006 +0300
@@ -480,12 +480,14 @@
 
 	*dotlock_r = NULL;
 
+	t_push();
 	dotlock = file_dotlock_alloc(set);
 	lock_path = t_strconcat(path, dotlock->settings.lock_suffix, NULL);
 
 	ret = dotlock_create(path, dotlock, flags, TRUE);
 	if (ret <= 0 || (flags & DOTLOCK_CREATE_FLAG_CHECKONLY) != 0) {
-		i_free(dotlock);
+		file_dotlock_free(dotlock);
+		t_pop();
 		return ret;
 	}
 
@@ -495,6 +497,7 @@
 	if (close(fd) < 0) {
 		i_error("close(%s) failed: %m", lock_path);
 		file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 
@@ -503,6 +506,7 @@
 	if (stat(lock_path, &st) < 0) {
 		i_error("stat(%s) failed: %m", lock_path);
                 file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 	/* extra sanity check won't hurt.. */
@@ -510,11 +514,13 @@
 		i_error("dotlock %s was immediately recreated under us",
 			lock_path);
                 file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 	dotlock->mtime = st.st_mtime;
 
 	*dotlock_r = dotlock;
+	t_pop();
 	return 1;
 }
 
@@ -587,7 +593,10 @@
 
 	dotlock = file_dotlock_alloc(set);
 
+	t_push();
 	ret = dotlock_create(path, dotlock, flags, FALSE);
+	t_pop();
+
 	if (ret <= 0) {
 		file_dotlock_free(dotlock);
 		*dotlock_r = NULL;