Skip to content

Commit

Permalink
AP_Scripting: fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed May 18, 2020
1 parent b368188 commit 97f3353
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libraries/AP_Logger/AP_Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,7 @@ AP_Logger::log_write_fmt *AP_Logger::msg_fmt_for_name(const char *name, const ch
}
} else {
// direct comparison used from scripting where pointer is not maintained
char *test_name = strdup(f->name);
if (strcmp(test_name,name) == 0) {
if (strcmp(f->name,name) == 0) {
// already have an ID for this name:
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
assert_same_fmt_for_name(f, name, labels, units, mults, fmt);
Expand Down

0 comments on commit 97f3353

Please sign in to comment.