MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_subprocess_free_config

Function cbm_subprocess_free_config

src/foundation/subprocess.c:623–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621#endif
622
623static void cbm_subprocess_free_config(cbm_subprocess_t *process) {
624 if (!process) {
625 return;
626 }
627 if (process->argv) {
628 for (size_t i = 0; i < process->argc; i++) {
629 free(process->argv[i]);
630 }
631 }
632 free(process->argv);
633#ifndef _WIN32
634 if (process->environment) {
635 for (size_t i = 0; process->environment[i]; i++) {
636 cbm_free(CBM_MEM_CLASS_OTHER, process->environment[i]);
637 }
638 }
639#endif
640 cbm_free(CBM_MEM_CLASS_OTHER, process->environment);
641#ifdef __APPLE__
642 cbm_free(CBM_MEM_CLASS_OTHER, process->search_path);
643#endif
644 free(process->bin);
645 free(process->windows_cmd_payload);
646 free(process->log_file);
647 cbm_arena_destroy(&process->stdout_arena);
648#ifndef _WIN32
649 cbm_git_child_env_free(process->envp);
650#endif
651 free(process);
652}
653
654static cbm_subprocess_t *cbm_subprocess_copy_opts(const cbm_proc_opts_t *opts) {
655 if (!opts || !opts->bin || !opts->bin[0]) {

Callers 3

cbm_subprocess_copy_optsFunction · 0.85
cbm_subprocess_spawnFunction · 0.85
cbm_subprocess_destroyFunction · 0.85

Calls 3

cbm_freeFunction · 0.85
cbm_git_child_env_freeFunction · 0.85
cbm_arena_destroyFunction · 0.70

Tested by

no test coverage detected