backend-drm: fix issues in libbacklight
The value of brightness node in backlight sys file may
end with '\n', which is not accepted by safe_strtoint
.
Another issue is that buffer
pointer is damaged by the
read
call, so it will be dangerous to free it if the
following asprintf
fails.