[CRIU] [PATCH] plugins: Don't return from inside a macro

Pavel Emelyanov xemul at parallels.com
Wed Dec 25 08:23:21 PST 2013


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 plugin.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugin.c b/plugin.c
index 542abdd..40abc9d 100644
--- a/plugin.c
+++ b/plugin.c
@@ -43,7 +43,7 @@ struct cr_plugins cr_plugins;
 			struct cr_plugin_entry *__ce;			\
 			__ce = xmalloc(sizeof(struct cr_plugin_entry));	\
 			if (__ce == NULL)				\
-				return -1;				\
+				goto nomem;				\
 			__ce->name = name;				\
 			__ce->next = cr_plugins.name;			\
 			cr_plugins.name = __ce;				\
@@ -111,7 +111,7 @@ static int cr_lib_load(char *path)
 	if (f_fini) {
 		ce = xmalloc(sizeof(struct cr_plugin_entry));
 		if (ce == NULL)
-			return -1;
+			goto nomem;
 		ce->cr_fini = f_fini;
 	}
 
@@ -127,6 +127,9 @@ static int cr_lib_load(char *path)
 	}
 
 	return 0;
+
+nomem:
+	return -1;
 }
 
 #define cr_plugin_free(name) do {				\
-- 
1.8.3.1


More information about the CRIU mailing list