shared: systemd: Fix use-after-free and double-free defects 74/120074/5
authorWook Song <wook16.song@samsung.com>
Tue, 21 Mar 2017 06:51:12 +0000 (15:51 +0900)
committerWook Song <wook16.song@samsung.com>
Mon, 27 Mar 2017 06:25:30 +0000 (15:25 +0900)
commit0c53e039b81859dab4c33b140ccaf3f10d36f089
tree8700768c06cbacb17123b473f644e49bc7a4c919
parent6c677a40ee31ffb75f728a9db90f226c9d05cdf7
shared: systemd: Fix use-after-free and double-free defects

This patch fixes the following code-leve defects according to static
program analysis result:

1. USE_AFTER_FREE: A pointer variable is used after the referenced
memory was deallocated by calling function 'free'.
2. DOUBLE_FREE.EX: A pointer is passed to the function 'free' after the
referenced memory was deallocated.

Change-Id: Ieef15d3432fb72068b9186c5807fedd1685ee79a
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
src/shared/pass-systemd.c