[freeswitch] Argument with 'nonnull' attribute passed null in reincarnate_protect()

This commit is contained in:
Andrey Volk 2021-04-06 01:19:57 +03:00
parent 58abf91d1d
commit 21952f26c1

View File

@ -390,13 +390,13 @@ static void reincarnate_protect(char **argv) {
sigaction(SIGTERM, &sa15_prev, NULL);
sigaction(SIGCHLD, &sa17_prev, NULL);
if (argv) {
if (execv(argv[0], argv) == -1) {
if (argv[0] && execv(argv[0], argv) == -1) {
char buf[256];
fprintf(stderr, "Reincarnate execv() failed: %d %s\n", errno,
switch_strerror_r(errno, buf, sizeof(buf)));
}
fprintf(stderr, "Trying reincarnate-reexec plan B...\n");
if (execvp(argv[0], argv) == -1) {
if (argv[0] && execvp(argv[0], argv) == -1) {
char buf[256];
fprintf(stderr, "Reincarnate execvp() failed: %d %s\n", errno,
switch_strerror_r(errno, buf, sizeof(buf)));