Commit ce3db28f authored by Nelson A. de Oliveira's avatar Nelson A. de Oliveira Committed by Kevin Cozens

Fix some memleaks

parent c0208e70
......@@ -242,6 +242,8 @@ guillotine (gint32 image_ID,
if (new_image == -1)
{
g_warning ("Couldn't create new image.");
g_free (hformat);
g_free (format);
return images;
}
......
......@@ -115,6 +115,7 @@ fread_pascal_string (gint32 *bytes_read,
if (fseek (f, 1, SEEK_CUR) < 0)
{
psd_set_error (feof (f), errno, error);
g_free (str);
return NULL;
}
(*bytes_read)++;
......@@ -174,12 +175,14 @@ fwrite_pascal_string (const gchar *src,
|| fwrite (pascal_str, pascal_len, 1, f) < 1)
{
psd_set_error (feof (f), errno, error);
g_free (pascal_str);
return -1;
}
bytes_written++;
bytes_written += pascal_len;
IFDBG(2) g_debug ("Pascal string: %s, bytes_written: %d",
pascal_str, bytes_written);
g_free (pascal_str);
}
/* Pad with nulls */
......@@ -263,6 +266,7 @@ fread_unicode_string (gint32 *bytes_read,
if (fseek (f, 1, SEEK_CUR) < 0)
{
psd_set_error (feof (f), errno, error);
g_free (utf16_str);
return NULL;
}
(*bytes_read)++;
......
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