Index: kernel/generic/src/ipc/ops/conctmeto.c
===================================================================
--- kernel/generic/src/ipc/ops/conctmeto.c	(revision eab96896da017b09ffd9ad8ca4def6bae35917b6)
+++ kernel/generic/src/ipc/ops/conctmeto.c	(revision 523b17ab2f8c2e7a9e49c9db766a7367e421455d)
@@ -74,12 +74,16 @@
 static int answer_process(call_t *answer)
 {
-	if (IPC_GET_RETVAL(answer->data) && ((int) answer->priv >= 0)) {
-		/*
-		 * Something went wrong and there is a phone that needs to be
-		 * deallocated.
-		 */
-		phone_dealloc(answer->priv);
+	int newphid = (int) answer->priv;
+
+	if (IPC_GET_RETVAL(answer->data)) {
+		if (newphid >= 0) {
+			/*
+			 * The phone was indeed allocated and now needs
+			 * to be deallocated.
+			 */
+			phone_dealloc(newphid);
+		}
 	} else {
-		IPC_SET_ARG5(answer->data, answer->priv);
+		IPC_SET_ARG5(answer->data, newphid);
 	}
 	
