Missing "break;"

Found by Cppcheck

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>
Fix possible memory leak

Found by Cppcheck

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>
Consider performing initialization in initialization list.

Found by Cppcheck

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>
Assignment of function parameter has no effect outside the function.

Found by Cppcheck

Signed-off-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>