Skip to content

Commit

Permalink
Avoid possible double-freeing memory
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Aug 17, 2012
1 parent d0ac385 commit 6f08f28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/shogun/structure/libp3bm.cpp
Expand Up @@ -746,6 +746,7 @@ bmrm_return_value_T svm_p3bm_solver(
cp_ptr2=cp_ptr;
cp_ptr=cp_ptr->next;
LIBBMRM_FREE(cp_ptr2);
cp_ptr2 = NULL;
}

cleanup:
Expand Down Expand Up @@ -773,9 +774,11 @@ bmrm_return_value_T svm_p3bm_solver(
LIBBMRM_FREE(H2);
LIBBMRM_FREE(C);
LIBBMRM_FREE(S);
LIBBMRM_FREE(cp_list);
LIBBMRM_FREE(Rt);

if (cp_list)
LIBBMRM_FREE(cp_list);

for (uint32_t p=0; p<cp_models; ++p)
{
LIBBMRM_FREE(subgrad_t[p]);
Expand Down

0 comments on commit 6f08f28

Please sign in to comment.