Hi,
Please find the latest report on new defect(s) introduced to sbabic/swupdate found with Coverity Scan.
** CID 653333: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
/mongoose/mongoose_interface.c: 870 in start_webserver()
_____________________________________________________________________________________________
*** CID 653333: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653333: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.root" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653333: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.root" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
** CID 653332: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
/mongoose/mongoose_interface.c: 870 in start_webserver()
_____________________________________________________________________________________________
*** CID 653332: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653332: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.global_auth_file" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653332: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.global_auth_file" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
** CID 653331: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
/mongoose/mongoose_interface.c: 870 in start_webserver()
_____________________________________________________________________________________________
*** CID 653331: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653331: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.ssl_key" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653331: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.ssl_key" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
** CID 653330: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
/mongoose/mongoose_interface.c: 870 in start_webserver()
_____________________________________________________________________________________________
*** CID 653330: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653330: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.auth_domain" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653330: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.auth_domain" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
** CID 653329: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
/mongoose/mongoose_interface.c: 870 in start_webserver()
_____________________________________________________________________________________________
*** CID 653329: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653329: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.ssl_cert" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653329: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.ssl_cert" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
** CID 653328: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 870 in start_webserver()
/mongoose/mongoose_interface.c: 863 in start_webserver()
_____________________________________________________________________________________________
*** CID 653328: (RESOURCE_LEAK)
/mongoose/mongoose_interface.c: 870 in start_webserver()
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
869 webserver_print_help();
>>> CID 653328: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.port" points to.
870 return -EINVAL;
871 }
872
873 s_http_server_opts.root_dir =
874 opts.root ? opts.root : MG_ROOT;
875 if (!opts.listing)
/mongoose/mongoose_interface.c: 863 in start_webserver()
857 case 'r':
858 free(opts.root);
859 opts.root = strdup(optarg);
860 break;
861 case '?':
862 default:
>>> CID 653328: (RESOURCE_LEAK)
>>> Variable "opts" going out of scope leaks the storage "opts.port" points to.
863 return -EINVAL;
864 }
865 }
866
867 if (optind < argc) {
868 ERROR("Non-option or unrecognized argument(s) given to webserver (-w), see --help.");
Best regards,
The Coverity Scan Admin Team