"out of memory" bug fix
diff --git a/communication.c b/communication.c
index d4b1c4d..4d02b05 100644
--- a/communication.c
+++ b/communication.c
@@ -623,9 +623,9 @@
 	if (repl->nentries) {
 		counters = (struct ebt_counter *)
 		   malloc(repl->nentries * sizeof(struct ebt_counter));
+		repl->counters = sparc_cast counters;
 		if (!repl->counters)
 			print_memory();
-		repl->counters = sparc_cast counters;
 	} else
 		repl->counters = sparc_cast NULL;
 	/* copy entries and counters */