File autofs-5.0.9-task-use-after-free.patch of Package autofs.3485

From: Leonardo Chiquitto <lchiquitto@suse.com>
Subject: fix segmentation fault in st_queue_handler()
References: bnc#727392

Index: autofs-5.0.9/daemon/state.c
===================================================================
--- autofs-5.0.9.orig/daemon/state.c
+++ autofs-5.0.9/daemon/state.c
@@ -1171,12 +1171,12 @@ remove:
 							struct state_queue, pending);
 
 				list_del(&task->list);
-				free(task);
 
 				list_del_init(&next->pending);
 				list_add_tail(&next->list, head);
 				if (p == head)
 					p = head->next;
+				free(task);
 			}
 
 			if (list_empty(head))