Skip to content

Commit

Permalink
Merge pull request #1 from dmamylin/patch-1
Browse files Browse the repository at this point in the history
Update polar_histogram.c
  • Loading branch information
agarie committed Mar 21, 2015
2 parents a004023 + ec91ec8 commit d8d0d35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion polar_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ hist_t * hist_init(int alpha, double threshold, double density_a,
hist->densities = (int *)malloc(hist->sectors * sizeof(int));

/* And is there enough memory for the densities array? */
if (NULL == hist->densities) return NULL;
if (NULL == hist->densities) {
free(hist);
return NULL;
}

/* Initialize all densities to 0. */
for (int i = 0; i < hist->sectors; ++i) {
Expand Down

0 comments on commit d8d0d35

Please sign in to comment.