Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In gp_file_set_data_and_size free file->data only if allocated
Browse files Browse the repository at this point in the history
Sija authored Nov 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a12a1b1 commit 0def3a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libgphoto2/gphoto2-file.c
Original file line number Diff line number Diff line change
@@ -320,7 +320,7 @@ gp_file_set_data_and_size (CameraFile *file, char *data,

switch (file->accesstype) {
case GP_FILE_ACCESSTYPE_MEMORY:
free (file->data);
if (file->data) free (file->data);
file->data = (unsigned char*)data;
file->size = size;
break;

0 comments on commit 0def3a8

Please sign in to comment.