committed by
GitHub
parent
35d313f4ab
commit
fd735fca4b
@@ -75,6 +75,11 @@ int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfi
|
||||
result_string = calloc(1, KUBECONFIG_EXEC_RESULT_BUFFER_SIZE);
|
||||
if (!result_string) {
|
||||
fprintf(stderr, "%s: Cannot allocate memory for command result.[%s]\n", fname, strerror(errno));
|
||||
#ifndef _WIN32
|
||||
pclose(fp);
|
||||
#else
|
||||
_pclose(fp);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
int result_string_remaining_size = KUBECONFIG_EXEC_RESULT_BUFFER_SIZE - 1;
|
||||
@@ -85,6 +90,11 @@ int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfi
|
||||
if (result_string_remaining_size <= 0) {
|
||||
fprintf(stderr, "%s: The buffer for exec result is not sufficient.\n", fname);
|
||||
rc = -1;
|
||||
#ifndef _WIN32
|
||||
pclose(fp);
|
||||
#else
|
||||
_pclose(fp);
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
strncat(result_string, string_buf, strlen(string_buf));
|
||||
|
||||
Reference in New Issue
Block a user