projects
/
platform
/
core
/
uifw
/
libds-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
042d623
)
keyrouter: Properly test for allocation failure
13/278213/1
author
Seunghun Lee
<shiin.lee@samsung.com>
Wed, 8 Jun 2022 07:25:42 +0000
(16:25 +0900)
committer
SooChan Lim
<sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:58:54 +0000
(14:58 +0900)
Instead of testing the return of the function just called, it was
testing something already checked earlier.
Change-Id: Ibaa7884360afaa195d843bc90588e3af85caf0d0
src/keyrouter/keyrouter_grab.c
patch
|
blob
|
history
diff --git
a/src/keyrouter/keyrouter_grab.c
b/src/keyrouter/keyrouter_grab.c
index
5009985
..
6af0c85
100644
(file)
--- a/
src/keyrouter/keyrouter_grab.c
+++ b/
src/keyrouter/keyrouter_grab.c
@@
-300,7
+300,7
@@
keyrouter_grab_create(void)
/* FIXME: Who defined max keycode? */
keyrouter_grab->hard_keys = calloc(KEYROUTER_MAX_KEYS, sizeof(struct ds_tizen_keyrouter_grabbed));
- if (keyrouter_grab == NULL) {
+ if (keyrouter_grab
->hard_keys
== NULL) {
ds_err("Failed to allocate memory.");
free(keyrouter_grab);
return NULL;