Commit 63f008bd authored by Philip Withnall's avatar Philip Withnall

tools: Fix an incorrect g_new() call

It was allocating an array of guint8 pointers, rather than an array of
guint8s. This resulted in an allocation 4 times too large, which is a
bug, but not one which would cause crashes.

Coverity ID: 1398303

https://bugzilla.gnome.org/show_bug.cgi?id=777833
parent dfe34c87
......@@ -53,7 +53,7 @@ read_contents (const gchar *file_name, guint8 **contents, gsize *length)
gsize bytes_read;
*length = g_file_info_get_size (file_info);
*contents = (guint8 *) g_new (guint8*, *length);
*contents = g_new (guint8, *length);
success = g_input_stream_read_all (G_INPUT_STREAM(input_stream),
*contents,
*length,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment