git.legacy.paulk.fr
/
hayes-ril.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
394d70a
)
Network: only strdup when there is actually data
author
Paul Kocialkowski
<contact@paulk.fr>
Tue, 31 Jul 2012 21:12:24 +0000
(23:12 +0200)
committer
Paul Kocialkowski
<contact@paulk.fr>
Tue, 31 Jul 2012 21:12:24 +0000
(23:12 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
network.c
patch
|
blob
|
history
diff --git
a/network.c
b/network.c
index
6b24467
..
62d359d
100644
(file)
--- a/
network.c
+++ b/
network.c
@@
-182,8
+182,10
@@
int at_creg_handle(char **registration_state, struct at_response_data **response
}
asprintf(&(registration_state[0]), "%d", state);
- registration_state[1] = strdup(lac);
- registration_state[2] = strdup(cid);
+ if(lac != NULL)
+ registration_state[1] = strdup(lac);
+ if(cid != NULL)
+ registration_state[2] = strdup(cid);
return 0;
}