From 02920989e23cd9c0aadf42a1f75bfc8239d7a0f6 Mon Sep 17 00:00:00 2001
From: Andrea Censi <andrea@cds.caltech.edu>
Date: Fri, 19 Jun 2009 02:37:55 +0000
Subject: [PATCH] failing properly

---
 sm/apps/sm2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sm/apps/sm2.c b/sm/apps/sm2.c
index 28f69ba..23d7c2d 100644
--- a/sm/apps/sm2.c
+++ b/sm/apps/sm2.c
@@ -123,7 +123,8 @@ int main(int argc, const char*argv[]) {
 		
 		if(!result.valid){
 			sm_error("One ICP matching failed. Because I process recursively, I will stop here.\n");
-			break;
+			ld_free(laser_ref);
+			return 2;
 		}
 		
 		/* Add the result to the previous estimate */
-- 
GitLab