Skip to content

Commit

Permalink
kconfig: qconf: use delete[] instead of delete to free array (again)
Browse files Browse the repository at this point in the history
Commit c9b09a9 ("kconfig: qconf: use delete[] instead of delete
to free array") fixed two lines, but there is one more.
(cppcheck does not report it for some reason...)

This was detected by Clang.

"make HOSTCXX=clang++ xconfig" reports the following:

scripts/kconfig/qconf.cc:1279:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
        delete data;
        ^
              []
scripts/kconfig/qconf.cc:1239:15: note: allocated with 'new[]' here
        char *data = new char[count + 1];
                     ^

Fixes: c4f7398 ("kconfig: qconf: make debug links work again")
Fixes: c9b09a9 ("kconfig: qconf: use delete[] instead of delete to free array")
Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
  • Loading branch information
masahir0y committed Sep 18, 2020
1 parent 856deb8 commit a608b6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ void ConfigInfoView::clicked(const QUrl &url)
}

free(result);
delete data;
delete[] data;
}

void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)
Expand Down

0 comments on commit a608b6a

Please sign in to comment.