projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c78805a
)
Refactor: Command line extraction
author
Denis Kenzior
<denkenz@gmail.com>
Mon, 22 Mar 2010 17:57:40 +0000
(12:57 -0500)
committer
Denis Kenzior
<denkenz@gmail.com>
Mon, 22 Mar 2010 17:59:04 +0000
(12:59 -0500)
gatchat/gatserver.c
patch
|
blob
|
history
diff --git
a/gatchat/gatserver.c
b/gatchat/gatserver.c
index
5e46ba2
..
efc2f3d
100644
(file)
--- a/
gatchat/gatserver.c
+++ b/
gatchat/gatserver.c
@@
-341,9
+341,6
@@
static void server_parse_line(GAtServer *server, char *line)
pos += consumed;
}
-
-done:
- g_free(line);
}
static enum ParserResult server_feed(GAtServer *server,
@@
-523,8
+520,17
@@
static void new_bytes(GAtServer *p)
break;
case PARSER_RESULT_COMMAND:
- server_parse_line(p, extract_line(p));
+ {
+ char *line = extract_line(p);
+
+ if (line) {
+ server_parse_line(p, line);
+ g_free(line);
+ } else
+ g_at_server_send_final(p,
+ G_AT_SERVER_RESULT_ERROR);
break;
+ }
case PARSER_RESULT_REPEAT_LAST:
/* TODO */