You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src: avoid leak parsing command line arguemnts in "nl-{class,qdisc}-add"
"id" could be overwritten, this causes coverity warnings. While not
severe, fix the coverity warnings by using _nl_clear_free().
Also use _nl_auto_free to release the memory.
Error: CLANG_WARNING: [#def79]
libnl-3.9.0/src/nl-class-add.c:73:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 71|
# 72| for (;;) {
# 73|-> int c, optidx = 0;
# 74| enum {
# 75| ARG_UPDATE = 257,
Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libnl-3.9.0/src/nl-class-add.c: scope_hint: In function ‘main’
libnl-3.9.0/src/nl-class-add.c:109:32: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
# 107| case 'd': nl_cli_tc_parse_dev(tc, link_cache, optarg); break;
# 108| case 'p': nl_cli_tc_parse_parent(tc, optarg); break;
# 109|-> case 'i': id = strdup(optarg); break;
# 110| case ARG_UPDATE: flags = NLM_F_CREATE; break;
# 111| case ARG_UPDATE_ONLY: flags = 0; break;
0 commit comments