summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci/commands')
-rw-r--r--src/hci/commands/nvo_cmd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/hci/commands/nvo_cmd.c b/src/hci/commands/nvo_cmd.c
index b3775d098..f255bbf57 100644
--- a/src/hci/commands/nvo_cmd.c
+++ b/src/hci/commands/nvo_cmd.c
@@ -213,15 +213,19 @@ static int read_value ( const char *name, char **args __unused, char **value ) {
/* Read existing value */
if ( ( rc = fetchf_named_setting_copy ( name, &existing ) ) < 0 )
- return rc;
+ goto err_existing;
/* Read new value */
- *value = readline_history ( NULL, existing, NULL );
+ if ( ( rc = readline_history ( NULL, existing, NULL, value ) ) != 0 )
+ goto err_new;
- /* Free existing value */
- free ( existing );
+ /* Success */
+ rc = 0;
- return 0;
+ err_new:
+ free ( existing );
+ err_existing:
+ return rc;
}
/**