File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1650,15 +1650,14 @@ PHP_FUNCTION(ifx_errormsg)
1650
1650
break ;
1651
1651
}
1652
1652
1653
- maxmsglen = 255 ;
1653
+ maxmsglen = 10 ;
1654
1654
msglen = maxmsglen; /* Some bug fix, rgetlmsg doesnt always set the value */
1655
- ifx_errmsg = (char *)malloc (maxmsglen + 1 );
1655
+ ifx_errmsg = (char *)emalloc (maxmsglen + 1 );
1656
1656
if (ifx_errorcode != 0 ) {
1657
1657
rgetlmsg (ifx_errorcode, ifx_errmsg, maxmsglen, &msglen);
1658
1658
if (msglen > maxmsglen) {
1659
- maxmsglen = msglen + 1 ;
1660
- free (ifx_errmsg);
1661
- ifx_errmsg = (char *)malloc (maxmsglen + 1 );
1659
+ maxmsglen = msglen;
1660
+ ifx_errmsg = (char *)erealloc (ifx_errmsg, maxmsglen + 1 );
1662
1661
rgetlmsg (ifx_errorcode, ifx_errmsg, maxmsglen, &msglen);
1663
1662
}
1664
1663
} else {
@@ -1667,7 +1666,7 @@ PHP_FUNCTION(ifx_errormsg)
1667
1666
1668
1667
returnmsg = (char *) emalloc (strlen (ifx_errmsg) + 128 );
1669
1668
sprintf (returnmsg, ifx_errmsg, sqlca.sqlerrm );
1670
- free (ifx_errmsg);
1669
+ efree (ifx_errmsg);
1671
1670
RETURN_STRING (returnmsg,0 );
1672
1671
}
1673
1672
/* }}} */
You can’t perform that action at this time.
0 commit comments