mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
smbd: Save a few lines with str_list_add_printf()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
6df560d353
commit
2468f04121
@ -80,21 +80,13 @@ static uint64_t sys_disk_free(connection_struct *conn,
|
||||
char **lines = NULL;
|
||||
char **argl = NULL;
|
||||
|
||||
argl = talloc_zero_array(talloc_tos(),
|
||||
char *,
|
||||
3);
|
||||
argl = str_list_make_empty(talloc_tos());
|
||||
str_list_add_printf(&argl, "%s", dfree_command);
|
||||
str_list_add_printf(&argl, "%s", path);
|
||||
if (argl == NULL) {
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
|
||||
argl[0] = talloc_strdup(argl, dfree_command);
|
||||
if (argl[0] == NULL) {
|
||||
TALLOC_FREE(argl);
|
||||
return (uint64_t)-1;
|
||||
}
|
||||
argl[1] = path;
|
||||
argl[2] = NULL;
|
||||
|
||||
DBG_NOTICE("Running command '%s %s'\n",
|
||||
dfree_command,
|
||||
path);
|
||||
|
Loading…
Reference in New Issue
Block a user