src/zabbix_get/zabbix_get.c:184
/* parse the command-line */ while ((char)EOF != (ch = (char)zbx_getopt_long(argc, argv, shortopts, longopts, NULL))) { switch (ch) { case 'k': key = strdup(zbx_optarg); break; case 'p': port = (unsigned short)atoi(zbx_optarg); break; case 's': host = strdup(zbx_optarg); break; case 'I': source_ip = strdup(zbx_optarg); break; case 'h': help(); exit(-1); break; case 'V': version(); exit(-1); break; default: usage(); exit(-1); break; } }
the variable source_ip allocated dynamically by strdup() is never freed. 3.0, 3.2 and trunk are not affected as the source_ip variables is properly freed in the out goto label.
Spotted by the clang static analyzer