projects
/
platform
/
core
/
connectivity
/
bluetooth-frwk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6906a6b
)
Fixed NULL pointer deference in bt-service/bt-service-obex-agent.c
83/42083/1
author
Anchit Narang
<anchit.n@samsung.com>
Tue, 23 Jun 2015 04:59:43 +0000
(10:29 +0530)
committer
Anchit Narang
<anchit.n@samsung.com>
Tue, 23 Jun 2015 04:59:43 +0000
(10:29 +0530)
Added NULL check after malloc to prevent bt-service crash if
enough memory cannot be allocated
Change-Id: Ia59ea7512107ceb4886b60183a7228bd7524520b
bt-service/bt-service-obex-agent.c
patch
|
blob
|
history
diff --git
a/bt-service/bt-service-obex-agent.c
b/bt-service/bt-service-obex-agent.c
index
6a988b3
..
174373e
100644
(file)
--- a/
bt-service/bt-service-obex-agent.c
+++ b/
bt-service/bt-service-obex-agent.c
@@
-389,6
+389,10
@@
void _bt_obex_agent_new(char *path)
}
}
info = (bt_obex_agent_info *)malloc (sizeof(bt_obex_agent_info));
+ if (info == NULL) {
+ BT_ERR("Failed to allocate memory");
+ return;
+ }
memset(info, 0, sizeof(bt_obex_agent_info));
info->path = g_strdup(path);
obex_agent_list = g_slist_append(obex_agent_list, info);