Skip to content

Commit

Permalink
lib/gpde: Fix Resource Leak issue in n_arrays_io.c (#4775)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Dec 2, 2024
1 parent 6d884a5 commit 80a574d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/gpde/n_arrays_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ N_array_2d *N_read_rast_to_array_2d(char *name, N_array_2d *array)

/* Close file */
Rast_close(map);
G_free(rast);

return data;
}
Expand Down Expand Up @@ -219,6 +220,9 @@ void N_write_array_2d_to_rast(N_array_2d *array, char *name)

/* Close file */
Rast_close(map);
G_free(rast);
G_free(frast);
G_free(drast);
}

/* ******************** 3D ARRAY FUNCTIONS *********************** */
Expand Down

0 comments on commit 80a574d

Please sign in to comment.