summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2018-06-03 13:08:59 +0200
committerMarcus Meissner <marcus@jet.franken.de>2018-06-03 13:08:59 +0200
commit80c1c8bb8120466bc97f017faf48b07dd67bc8cc (patch)
treeba804eed8eae49acb1ea1dcf7f5a145d2a51b26e /libgphoto2
parent3b1c6e825947c671064acfbb3edb99d28b893bc6 (diff)
downloadlibgphoto2-80c1c8bb8120466bc97f017faf48b07dd67bc8cc.tar.gz
added note on ownership of the "data" pointer after gp_file_get_data_and_size
fixes https://github.com/gphoto/libgphoto2/issues/278
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/gphoto2-file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libgphoto2/gphoto2-file.c b/libgphoto2/gphoto2-file.c
index 6fd48d43e..9a718e02a 100644
--- a/libgphoto2/gphoto2-file.c
+++ b/libgphoto2/gphoto2-file.c
@@ -386,8 +386,12 @@ gp_file_set_data_and_size (CameraFile *file, char *data,
*
* Both data and size can be NULL and will then be ignored.
*
- * The pointer to data that is returned is still owned by libgphoto2
- * and its lifetime is the same as the #file.
+ * For regular CameraFiles, the pointer to data that is returned is
+ * still owned by libgphoto2 and its lifetime is the same as the #file.
+ *
+ * For filedescriptor or handler based CameraFile types, the returned
+ * data pointer is owned by the caller and needs to be free()d to avoid
+ * memory leaks.
*
**/
int