projects
/
platform
/
core
/
system
/
peripheral-bus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1c0203
)
i2c: fixed that allocated memory is released when an error occurs.
18/154518/1
author
Segwon
<segwon.han@samsung.com>
Tue, 10 Oct 2017 10:38:42 +0000
(19:38 +0900)
committer
Segwon
<segwon.han@samsung.com>
Tue, 10 Oct 2017 10:38:42 +0000
(19:38 +0900)
Change-Id: Ib2c6589ad52b3752297bf6579527b574dba3b3d6
Signed-off-by: Segwon <segwon.han@samsung.com>
src/daemon/peripheral_bus_i2c.c
patch
|
blob
|
history
diff --git
a/src/daemon/peripheral_bus_i2c.c
b/src/daemon/peripheral_bus_i2c.c
index
f989022
..
d55bcef
100644
(file)
--- a/
src/daemon/peripheral_bus_i2c.c
+++ b/
src/daemon/peripheral_bus_i2c.c
@@
-86,6
+86,7
@@
int peripheral_bus_i2c_open(int bus, int address, pb_data_h *handle, gpointer us
i2c_handle->dev.i2c.buffer = malloc(INITIAL_BUFFER_SIZE);
if (!(i2c_handle->dev.i2c.buffer)) {
+ peripheral_bus_data_free(i2c_handle);
i2c_close(fd);
_E("Failed to allocate data buffer");
return PERIPHERAL_ERROR_OUT_OF_MEMORY;