diff options
Diffstat (limited to 'src/slave/kpropd.c')
-rw-r--r-- | src/slave/kpropd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 959dd4ab5c..123b2fe661 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -1082,14 +1082,11 @@ void PRS(argv) /* * Construct the name of the temporary file. */ - if ((temp_file_name = (char *) malloc(strlen(file) + - strlen(tmp) + 1)) == NULL) { + if (asprintf(&temp_file_name, "%s%s", file, tmp) < 0) { com_err(progname, ENOMEM, "while allocating filename for temp file"); exit(1); } - strcpy(temp_file_name, file); - strcat(temp_file_name, tmp); retval = kadm5_get_config_params(kpropd_context, 1, ¶ms, ¶ms); if (retval) { |