Prevent freeing of uninitialized pointer
> variable 'buf' is used uninitialized whenever 'if' condition is true Note: freeing a NULL pointer is fine.
This commit is contained in:
parent
5062dd61bc
commit
205dd76096
|
@ -66,13 +66,13 @@ static Con *_create___i3(void) {
|
||||||
bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) {
|
bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
char *globbed = resolve_tilde(path);
|
char *globbed = resolve_tilde(path);
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
if (!path_exists(globbed)) {
|
if (!path_exists(globbed)) {
|
||||||
LOG("%s does not exist, not restoring tree\n", globbed);
|
LOG("%s does not exist, not restoring tree\n", globbed);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *buf = NULL;
|
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
if ((len = slurp(globbed, &buf)) < 0) {
|
if ((len = slurp(globbed, &buf)) < 0) {
|
||||||
/* slurp already logged an error. */
|
/* slurp already logged an error. */
|
||||||
|
|
Loading…
Reference in New Issue