vmount: fix null-pointer access if invalid output mode was selected

In case of an invalid output mode, thread_data.output_obj was null.
This commit is contained in:
Beat Küng
2017-04-24 16:49:26 +02:00
committed by Lorenz Meier
parent 2ef5ebb6db
commit f42a626527
+4
View File
@@ -272,6 +272,7 @@ static int vmount_thread_main(int argc, char *argv[])
default:
PX4_ERR("invalid output mode %i", params.mnt_mode_out);
thread_should_exit = true;
break;
}
@@ -279,6 +280,9 @@ static int vmount_thread_main(int argc, char *argv[])
thread_data.input_objs_len = 0;
PX4_ERR("memory allocation failed");
thread_should_exit = true;
}
if (thread_should_exit) {
break;
}