X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fimpress%2Fiksemel.c;h=9908e132e3037e4ed6630aba0170a41c52f0fc6b;hb=3d3c4a5a08f1b8b536542735110c1376fb3e30bf;hp=6d24d43a339b54bdf990efb11f188ad868aee8f3;hpb=13a06349251874bd35d2f03c3fc93217cee749a2;p=evince.git diff --git a/backend/impress/iksemel.c b/backend/impress/iksemel.c index 6d24d43a..9908e132 100644 --- a/backend/impress/iksemel.c +++ b/backend/impress/iksemel.c @@ -33,6 +33,7 @@ ** modify it under the terms of GNU Lesser General Public License. */ +#include #include #include "common.h" @@ -760,11 +761,11 @@ sax_core (iksparser *prs, char *buf, int len) if (prs->attcur >= (prs->attmax * 2)) { void *tmp; prs->attmax += 12; - tmp = iks_malloc (sizeof(char *) * 2 * prs->attmax); + tmp = iks_malloc (sizeof(char *) * (2 * prs->attmax + 1)); if (!tmp) return IKS_NOMEM; - memset (tmp, 0, sizeof(char *) * 2 * prs->attmax); + memset (tmp, 0, sizeof(char *) * (2 * prs->attmax + 1)); memcpy (tmp, prs->atts, sizeof(char *) * prs->attcur); - free (prs->atts); + iks_free (prs->atts); prs->atts = tmp; } }