You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "maskit (via GitHub)" <gi...@apache.org> on 2023/08/16 17:53:28 UTC

[GitHub] [trafficserver] maskit opened a new issue, #10198: CID 1508999: Resource leak

maskit opened a new issue, #10198:
URL: https://github.com/apache/trafficserver/issues/10198

   ```
   432void
   433TSPluginInit(int argc, const char *argv[])
   434{
      	1. Condition !atscppapi::RegisterGlobalPlugin("CPP_Example_Boom", "apache", "dev@trafficserver.apache.org"), taking false branch.
   435  if (!RegisterGlobalPlugin("CPP_Example_Boom", "apache", "dev@trafficserver.apache.org")) {
   436    return;
   437  }
   438  boom_counter.init(BOOM_COUNTER);
      	2. alloc_fn: Storage is returned from allocation function operator new.
      	3. var_assign: Assigning: pregistry = storage returned from new BoomResponseRegistry.
   439  BoomResponseRegistry *pregistry = new BoomResponseRegistry();
   440
   441  // If base directory and list of codes are specified,
   442  // create a custom registry and initialize Boom with it.
   443  // Otherwise, run with default registry.
      	4. Condition argc == 3, taking true branch.
   444  if (argc == 3) {
   445    std::string base_directory(argv[1], strlen(argv[1]));
      	5. noescape: Resource pregistry is not freed or pointed-to in populate_error_responses. [[show details](https://scan6.scan.coverity.com/eventId=34625569-5&modelId=34625569-0&fileInstanceId=162997232&filePath=%2Fexample%2Fplugins%2Fcpp-api%2Fboom%2Fboom.cc&fileStart=208&fileEnd=245)]
   446    pregistry->populate_error_responses(base_directory);
   447
   448    std::string error_codes_argument(argv[2], strlen(argv[2]));
   449    std::vector<std::string> error_codes;
   450    stringSplit(error_codes_argument, ',', error_codes);
      	6. noescape: Resource pregistry is not freed or pointed-to in register_error_codes. [[show details](https://scan6.scan.coverity.com/eventId=34625569-7&modelId=34625569-1&fileInstanceId=162997232&filePath=%2Fexample%2Fplugins%2Fcpp-api%2Fboom%2Fboom.cc&fileStart=194&fileEnd=201)]
   451    pregistry->register_error_codes(error_codes);
      	7. Falling through to end of if statement.
   452  } else {
   453    TS_ERROR(TAG, "Invalid number of command line arguments, using compile time defaults.");
   454  }
   455
      	8. noescape: Resource pregistry is not freed or pointed-to in BoomGlobalPlugin. [[show details](https://scan6.scan.coverity.com/eventId=34625569-11&modelId=34625569-2&fileInstanceId=162997232&filePath=%2Fexample%2Fplugins%2Fcpp-api%2Fboom%2Fboom.cc&fileStart=384&fileEnd=388)]
   456  plugin = new BoomGlobalPlugin(pregistry);
      	
   CID 1508999 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
   9. leaked_storage: Variable pregistry going out of scope leaks the storage it points to.
   457}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CID 1508999: Resource leak [trafficserver]

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras closed issue #10198: CID 1508999: Resource leak
URL: https://github.com/apache/trafficserver/issues/10198


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CID 1508999: Resource leak [trafficserver]

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on issue #10198:
URL: https://github.com/apache/trafficserver/issues/10198#issuecomment-1780234972

   It looks like all the all the CPP API example code was deleted by commit 286b98ef84c4261bdba1760780c47eeff5e6f72b .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org