OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
972c921
)
gatttool: Fix memory leak after parsing input line
author
Jefferson Delfes
<jefferson.delfes@openbossa.org>
Tue, 2 Apr 2013 23:31:18 +0000
(19:31 -0400)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Sun, 7 Apr 2013 15:09:58 +0000
(18:09 +0300)
The callback is responsible for freeing input line buffer that comes
from rl_callback_handler_install().
attrib/interactive.c
patch
|
blob
|
history
diff --git
a/attrib/interactive.c
b/attrib/interactive.c
index
a99ad0a
..
9f72453
100644
(file)
--- a/
attrib/interactive.c
+++ b/
attrib/interactive.c
@@
-850,7
+850,7
@@
static void parse_line(char *line_read)
line_read = g_strstrip(line_read);
if (*line_read == '\0')
-
return
;
+
goto done
;
add_history(line_read);
@@
-866,6
+866,9
@@
static void parse_line(char *line_read)
printf("%s: command not found\n", argvp[0]);
g_strfreev(argvp);
+
+done:
+ free(line_read);
}
static gboolean prompt_read(GIOChannel *chan, GIOCondition cond,