SITL: fixed coverity 125055

This commit is contained in:
Andrew Tridgell 2016-04-26 16:46:06 +10:00
parent ed4e8b635a
commit 785ad0614a
1 changed files with 4 additions and 0 deletions

View File

@ -80,18 +80,22 @@ bool Aircraft::parse_home(const char *home_str, Location &loc, float &yaw_degree
}
char *lat_s = strtok_r(s, ",", &saveptr);
if (!lat_s) {
free(s);
return false;
}
char *lon_s = strtok_r(NULL, ",", &saveptr);
if (!lon_s) {
free(s);
return false;
}
char *alt_s = strtok_r(NULL, ",", &saveptr);
if (!alt_s) {
free(s);
return false;
}
char *yaw_s = strtok_r(NULL, ",", &saveptr);
if (!yaw_s) {
free(s);
return false;
}