mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
scanner: Fix valgrind errors
This commit is contained in:
parent
620d9edb25
commit
1bade73b6b
1 changed files with 7 additions and 8 deletions
|
|
@ -393,6 +393,8 @@ start_element(void *data, const char *element_name, const char **atts)
|
||||||
case OBJECT:
|
case OBJECT:
|
||||||
if (interface_name)
|
if (interface_name)
|
||||||
arg->interface_name = strdup(interface_name);
|
arg->interface_name = strdup(interface_name);
|
||||||
|
else
|
||||||
|
arg->interface_name = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (interface_name != NULL)
|
if (interface_name != NULL)
|
||||||
|
|
@ -449,10 +451,7 @@ start_element(void *data, const char *element_name, const char **atts)
|
||||||
fail(ctx, "description without summary");
|
fail(ctx, "description without summary");
|
||||||
|
|
||||||
description = malloc(sizeof *description);
|
description = malloc(sizeof *description);
|
||||||
if (summary)
|
|
||||||
description->summary = strdup(summary);
|
description->summary = strdup(summary);
|
||||||
else
|
|
||||||
description->summary = NULL;
|
|
||||||
|
|
||||||
if (ctx->message)
|
if (ctx->message)
|
||||||
ctx->message->description = description;
|
ctx->message->description = description;
|
||||||
|
|
@ -476,10 +475,9 @@ end_element(void *data, const XML_Char *name)
|
||||||
strndup(ctx->character_data,
|
strndup(ctx->character_data,
|
||||||
ctx->character_data_length);
|
ctx->character_data_length);
|
||||||
} else if (strcmp(name, "description") == 0) {
|
} else if (strcmp(name, "description") == 0) {
|
||||||
char *text = strndup(ctx->character_data,
|
ctx->description->text =
|
||||||
|
strndup(ctx->character_data,
|
||||||
ctx->character_data_length);
|
ctx->character_data_length);
|
||||||
if (text)
|
|
||||||
ctx->description->text = text;
|
|
||||||
ctx->description = NULL;
|
ctx->description = NULL;
|
||||||
} else if (strcmp(name, "request") == 0 ||
|
} else if (strcmp(name, "request") == 0 ||
|
||||||
strcmp(name, "event") == 0) {
|
strcmp(name, "event") == 0) {
|
||||||
|
|
@ -1147,6 +1145,7 @@ int main(int argc, char *argv[])
|
||||||
protocol.type_index = 0;
|
protocol.type_index = 0;
|
||||||
protocol.null_run_length = 0;
|
protocol.null_run_length = 0;
|
||||||
protocol.copyright = NULL;
|
protocol.copyright = NULL;
|
||||||
|
memset(&ctx, 0, sizeof ctx);
|
||||||
ctx.protocol = &protocol;
|
ctx.protocol = &protocol;
|
||||||
|
|
||||||
ctx.filename = "<stdin>";
|
ctx.filename = "<stdin>";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue