We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue created by migration from Trac.
Original creator: casper
Original creation time: 2018-10-22 23:01:06
Assignee: @tkralphs
Version: 5.6.16
Keywords: memory leak
There is a memory leak in cg_func.c::cg_add_explicit_cut():
int cg_add_explicit_cut(int nzcnt, int *indices, double *values, double rhs, double range, char sense, char send_to_cp, int *num_cuts, int *alloc_cuts, cut_data ***cuts) { cut_data *cut = (cut_data *) calloc(1, sizeof(cut_data)); cut->type = EXPLICIT_ROW; cut->sense = sense; cut->rhs = rhs; cut->range = range; cut->size = (int)(DSIZE + nzcnt * (ISIZE + DSIZE)); cut->coef = (char *) malloc (cut->size); ((double *) cut->coef)[0] = 0; // otherwise valgrind complains. ((int *) cut->coef)[0] = nzcnt; //Here, we have to pad the initial int to avoid misalignment, so we //add DSIZE bytes to get to a double boundary memcpy(cut->coef + DSIZE, (char *)values, nzcnt * DSIZE); memcpy(cut->coef + (nzcnt + 1) * DSIZE, (char *)indices, nzcnt*ISIZE); cut->branch = DO_NOT_BRANCH_ON_THIS_ROW; cut->deletable = TRUE; cut->name = send_to_cp ? CUT__SEND_TO_CP : CUT__DO_NOT_SEND_TO_CP; /* CNMCNMCNM * leaks memory as cut and cut->coef allocated above are not freed * user work around is possible using create_explicit_cut() and cg_add_user_cut() */ /* return(cg_add_user_cut(cut, num_cuts, alloc_cuts, cuts)); */ int retval = cg_add_user_cut(cut, num_cuts, alloc_cuts, cuts); free(cut->coef); free(cut); return retval; }
The text was updated successfully, but these errors were encountered:
tkralphs
No branches or pull requests
Issue created by migration from Trac.
Original creator: casper
Original creation time: 2018-10-22 23:01:06
Assignee: @tkralphs
Version: 5.6.16
Keywords: memory leak
There is a memory leak in cg_func.c::cg_add_explicit_cut():
The text was updated successfully, but these errors were encountered: