Skip to content

Commit

Permalink
Fix crash if obs_module_file returns NULL
Browse files Browse the repository at this point in the history
If installed with `cmake --install`, obs_module_file returned NULL.
To gracely report the error, check the return code of obs_module_file.
  • Loading branch information
norihiro committed Apr 22, 2024
1 parent c0d5e17 commit bea54bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/capdev-nix.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ static pid_t thread_start_proc(const char *name, int *fd_req, int *fd_data)
}

char *proc_path = obs_module_file(PROC_4219);
if (!proc_path) {
blog(LOG_ERROR, "failed to find '%s'", PROC_4219);
return -1;
}

// TODO: consider using vfork
pid_t pid = fork();
Expand Down

0 comments on commit bea54bd

Please sign in to comment.