for(int i=0;i<160;i++)
{
result[i]=cvCreateImage(cvGetSize(Segimg), 8, 1);
}
Here 160 images are allocated and assigned to result[0] to result[159].
*result=method();
Here result[0] is overwritten with address returned from method.
If result[0] is not properly deleted by calling cvReleaseImage, it will create memory leak.
And all allocated images should be deleted by calling cvReleaseImage like this.
for(int i=0;i<160;i++)
{
cvReleaseImage(&result[i]);
}