Commit 2566a145 by Tycho Andersen Committed by Serge Hallyn

criu: DECLARE_ARG should check for null arguments

This is in preparation for the cgroups creation work, but also probably just a good idea in general. The ERROR message is handy since we print line nos. it will to give people an indication of what arg was null. Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 9a64d3cf
...@@ -3556,6 +3556,10 @@ static void exec_criu(struct criu_opts *opts) ...@@ -3556,6 +3556,10 @@ static void exec_criu(struct criu_opts *opts)
#define DECLARE_ARG(arg) \ #define DECLARE_ARG(arg) \
do { \ do { \
if (arg == NULL) { \
ERROR("Got NULL argument for criu"); \
goto err; \
} \
argv[argc++] = strdup(arg); \ argv[argc++] = strdup(arg); \
if (!argv[argc-1]) \ if (!argv[argc-1]) \
goto err; \ goto err; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment