1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

CONC-292: Fxed malloc result check in dynamic columns

Note: this was already fixed in server code, but not in C/C.
This commit is contained in:
Georg Richter
2017-11-08 04:56:04 +01:00
parent f3944bbd36
commit ab8477169a

View File

@@ -4042,7 +4042,7 @@ mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val)
case DYN_COL_STRING:
{
char *str, *end;
if ((str= malloc(val->x.string.value.length + 1)))
if (!(str= malloc(val->x.string.value.length + 1)))
return ER_DYNCOL_RESOURCE;
memcpy(str, val->x.string.value.str, val->x.string.value.length);
str[val->x.string.value.length]= '\0';