diff -Nacr a/bind.c b/bind.c *** a/bind.c 2016-01-10 22:25:14.000000000 +0900 --- b/bind.c 2016-03-29 10:29:55.000000000 +0900 *************** *** 228,234 **** extend_getdata_info(gdata_info, icol, FALSE); /* check to see if the bindings were allocated */ ! if (!opts->bindings) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Could not allocate memory for bindings.", func); ret = SQL_ERROR; --- 228,234 ---- extend_getdata_info(gdata_info, icol, FALSE); /* check to see if the bindings were allocated */ ! if (!opts->bindings || !gdata_info->gdata) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Could not allocate memory for bindings.", func); ret = SQL_ERROR; *************** *** 506,511 **** --- 506,513 ---- { mylog("%s: unable to create %d new bindings from %d old bindings\n", func, num_params, self->allocated); + if (self->parameters) + free(self->parameters); self->parameters = NULL; self->allocated = 0; return; *************** *** 538,543 **** --- 540,547 ---- { mylog("%s: unable to create %d new bindings from %d old bindings\n", func, num_params, self->allocated); + if (self->parameters) + free(self->parameters); self->parameters = NULL; self->allocated = 0; return;