Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx> --- src/conffile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conffile.c b/src/conffile.c index 8a208d6d8cfe..e58f54778e41 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -104,12 +104,10 @@ int config_register_file(const char *file) pr_debug("%s: registered config file '%s'\n", __func__, file); - fname = malloc(strlen(file)+1); + fname = strdup(file); if (!fname) return -ERROOM; - strcpy(fname, file); - return 0; } -- 2.35.1