static void clear_stack(void) {
for (int c = 0; c < 10; c++) {
- if (stack[c].type == STACK_STR && stack[c].val.str != NULL)
+ if (stack[c].type == STACK_STR)
free(stack[c].val.str);
stack[c].identifier = NULL;
stack[c].val.str = NULL;
DLOG("Found Xft.dpi = %ld.\n", dpi);
init_dpi_end:
- if (resource != NULL) {
- free(resource);
- }
+ free(resource);
if (database != NULL) {
xcb_xrm_database_free(database);
error->error_code);
}
}
- if (error != NULL) {
- free(error);
- }
+ free(error);
font.pattern = sstrdup(pattern);
LOG("Using X font %s\n", pattern);
case FONT_TYPE_XCB: {
/* Close the font and free the info */
xcb_close_font(conn, savedFont->specific.xcb.id);
- if (savedFont->specific.xcb.info)
- free(savedFont->specific.xcb.info);
+ free(savedFont->specific.xcb.info);
break;
}
case FONT_TYPE_PANGO:
// TODO move to a common util
static void clear_stack(void) {
for (int c = 0; c < 10; c++) {
- if (stack[c].type == STACK_STR && stack[c].val.str != NULL)
+ if (stack[c].type == STACK_STR)
free(stack[c].val.str);
stack[c].identifier = NULL;
stack[c].val.str = NULL;
static void clear_stack(void) {
for (int c = 0; c < 10; c++) {
- if (stack[c].type == STACK_STR && stack[c].val.str != NULL)
+ if (stack[c].type == STACK_STR)
free(stack[c].val.str);
stack[c].identifier = NULL;
stack[c].val.str = NULL;
free(marks[i]);
}
- free(marks);
- marks = NULL;
+ FREE(marks);
num_marks = 0;
}
fclose(f);
if ((ssize_t)n != stbuf.st_size) {
ELOG("File \"%s\" could not be read entirely: got %zd, want %" PRIi64 "\n", path, n, (int64_t)stbuf.st_size);
- free(*buf);
- *buf = NULL;
+ FREE(*buf);
return -1;
}
return (ssize_t)n;