Details

    • Type: Problem report
    • Status: Closed
    • Priority: Trivial
    • Resolution: Won't fix
    • Affects Version/s: 2.2.17
    • Fix Version/s: None
    • Component/s: Agent (G)
    • Labels:
    • Sprint:
      Sprint 14
    • Story Points:
      0.5

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              abs Andrea Biscuola (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: