diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2021-11-28 15:28:37 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2021-11-28 15:28:37 +0100 |
commit | e43230ef450dfe9edaeb394fa23124ec9dbd3716 (patch) | |
tree | 17f4bda2fedea1bf417f0a3dc27a20dc6f4ee4ff /examples | |
parent | 27939ca769bf7220a62df87816037949e762ff54 (diff) | |
download | libgphoto2-e43230ef450dfe9edaeb394fa23124ec9dbd3716.tar.gz |
avoid crash on freed memory
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sample-afl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/sample-afl.c b/examples/sample-afl.c index faca75fee..26f7ae044 100644 --- a/examples/sample-afl.c +++ b/examples/sample-afl.c @@ -182,13 +182,15 @@ int main(int argc, char **argv) { ret = gp_list_get_name(list, 0, &name); if (ret < GP_OK) goto out; - gp_list_free (list); + fprintf(stderr, "name is %s\n", name); ret = sample_open_camera (&camera, name, buf, context); if (ret < GP_OK) { fprintf(stderr,"camera %s at %s not found.\n", name, buf); + gp_list_free (list); goto out; } + gp_list_free (list); ret = gp_camera_init (camera, context); if (ret < GP_OK) { |