int pakfire_parser_parse_data(struct pakfire_parser* parent, const char* data, size_t len,
struct pakfire_parser_error** error) {
struct pakfire* pakfire = pakfire_parser_get_pakfire(parent);
+ char* dump = NULL;
yyscan_t scanner;
// Initialize the parser's state
clock_t t_end = clock();
// Log what we have in the parent parser now
- char* dump = pakfire_parser_dump(parent);
-
- DEBUG(pakfire, "Status of the parser %p:\n%s\n", parent, dump);
- free(dump);
+ dump = pakfire_parser_dump(parent);
+ if (dump)
+ DEBUG(pakfire, "Status of the parser %p:\n%s\n", parent, dump);
// Log time we needed to parse data
DEBUG(pakfire, "Parser finished in %.4fms\n",
#endif
// Cleanup
+ if (dump)
+ free(dump);
pakfire_unref(pakfire);
yylex_destroy(scanner);