summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-04-11 19:56:23 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-04-11 19:56:23 +0000
commite403964868c248354a614c13a79ae1f434114185 (patch)
tree64b318516991d8814b1c9b1277ce55d57efff396 /tests
parent13be84341238683dc58de89df4b74f85c8af98b6 (diff)
downloadlibgphoto2-e403964868c248354a614c13a79ae1f434114185.tar.gz
From: "Daniel P. Berrange" <dan@berrange.com>
The test-filesys.c code is calling gp_filesystem_get_folder and passing in a 'const char **' instead of 'char **'. It then forgets to free the heap-allocated result. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14892 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'tests')
-rw-r--r--tests/test-filesys.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test-filesys.c b/tests/test-filesys.c
index 492dbada0..6771b434b 100644
--- a/tests/test-filesys.c
+++ b/tests/test-filesys.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_MCHECK_H
#include <mcheck.h>
@@ -145,6 +146,7 @@ main ()
CameraList *list;
int x, count;
const char *name;
+ char *foldername;
GPContext *context;
#ifdef HAVE_MCHECK_H
@@ -268,8 +270,9 @@ main ()
}
printf ("*** Getting folder of 'file1'...\n");
- CHECK (gp_filesystem_get_folder (fs, "file1", &name, context));
- printf ("... found in '%s'.\n", name);
+ CHECK (gp_filesystem_get_folder (fs, "file1", &foldername, context));
+ printf ("... found in '%s'.\n", foldername);
+ free(foldername);
printf ("*** Deleting a couple of files...\n");
CHECK (gp_filesystem_delete_file (fs, "/whatever", "file5", context));