Commit ff394fc1 authored by Daan Vreeken's avatar Daan Vreeken
Browse files

Add missing checks for controller_block_add()'s return value.

	modified:   dt_azimuth/dt_az_safety.c
	modified:   dt_elevation/dt_el_safety.c
parent a454f2d6
......@@ -349,7 +349,8 @@ static struct controller_block * block_dt_az_safety_create(char *name, int argc,
if (controller_block_param_list_add(safety, params))
goto err_output;
controller_block_add(safety);
if (controller_block_add(safety) != 0)
goto err_add;
safety->private->command = controller_command_create(
safety, name, "Recover");
......@@ -358,6 +359,7 @@ static struct controller_block * block_dt_az_safety_create(char *name, int argc,
return safety;
err_add:
err_output:
free(safety->output);
err_input:
......
......@@ -573,7 +573,8 @@ static struct controller_block * block_dt_el_safety_create(char *name, int argc,
if (controller_block_param_list_add(safety, params))
goto err_output;
controller_block_add(safety);
if (controller_block_add(safety) != 0)
goto err_add;
safety->private->command = controller_command_create(
safety, name, "Recover");
......@@ -582,6 +583,7 @@ static struct controller_block * block_dt_el_safety_create(char *name, int argc,
return safety;
err_add:
err_output:
free(safety->output);
err_input:
......
Supports Markdown
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