Skip to content

Commit

Permalink
CONC-292: Fxed malloc result check in dynamic columns
Browse files Browse the repository at this point in the history
Note: this was already fixed in server code, but not in C/C.
  • Loading branch information
9EOR9 committed Nov 8, 2017
1 parent c979378 commit 1e6cdb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libmariadb/mariadb_dyncol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 1e6cdb8

Please sign in to comment.