Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Unlikely) memory leak in xcb_query_text_width #3621

Closed
psychon opened this issue Feb 15, 2019 · 2 comments
Closed

(Unlikely) memory leak in xcb_query_text_width #3621

psychon opened this issue Feb 15, 2019 · 2 comments
Labels
4.16 bug good first issue reproducible A bug that has been reviewed and confirmed by a project contributor

Comments

@psychon
Copy link
Contributor

psychon commented Feb 15, 2019

i3/libi3/font.c

Lines 427 to 444 in 2d6e09a

/* Query the text width */
xcb_generic_error_t *error;
xcb_query_text_extents_cookie_t cookie = xcb_query_text_extents(conn,
savedFont->specific.xcb.id, text_len, (xcb_char2b_t *)text);
xcb_query_text_extents_reply_t *reply = xcb_query_text_extents_reply(conn,
cookie, &error);
if (reply == NULL) {
/* We return a safe estimate because a rendering error is better than
* a crash. Plus, the user will see the error in their log. */
fprintf(stderr, "Could not get text extents (X error code %d)\n",
error->error_code);
return savedFont->specific.xcb.info->max_bounds.character_width * text_len;
}
int width = reply->overall_width;
free(reply);
return width;
}

What happened to free(error) inside reply == NULL?

@i3bot
Copy link

i3bot commented Feb 15, 2019

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added missing-log Read the CONTRIBUTING.md file for instructions missing-version labels Feb 15, 2019
@i3bot
Copy link

i3bot commented Feb 15, 2019

I don’t see a version number. Could you please copy & paste the output of i3 --version into this issue?

@orestisfl orestisfl added bug reproducible A bug that has been reviewed and confirmed by a project contributor good first issue 4.16 and removed missing-log Read the CONTRIBUTING.md file for instructions missing-version labels Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.16 bug good first issue reproducible A bug that has been reviewed and confirmed by a project contributor
Projects
None yet
Development

No branches or pull requests

3 participants