diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-07-21 20:44:18 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-07-21 20:44:18 +0000 |
commit | b0d404cae50bd0aff73a73c3722cc3cfb81e7d25 (patch) | |
tree | 257525aaf8d727054bc00553d84226113125817d /libgphoto2/gphoto2-camera.c | |
parent | b04b755500defcb12d4152db13dc52fbdfa8f443 (diff) | |
download | libgphoto2-b0d404cae50bd0aff73a73c3722cc3cfb81e7d25.tar.gz |
From: Axel Waggershauser <awagger@web.de>
3) use the fact that realloc() is defined to simply malloc if the
first param is NULL, no need to manually distinguish between first and
later allocations.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15098 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-camera.c')
-rw-r--r-- | libgphoto2/gphoto2-camera.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libgphoto2/gphoto2-camera.c b/libgphoto2/gphoto2-camera.c index f8c6f2348..cfe97ae15 100644 --- a/libgphoto2/gphoto2-camera.c +++ b/libgphoto2/gphoto2-camera.c @@ -1593,7 +1593,6 @@ gp_camera_start_timeout (Camera *camera, unsigned int timeout, CameraTimeoutFunc func) { int id; - unsigned int *ids; if (!camera || !camera->pc) return (GP_ERROR_BAD_PARAMETERS); @@ -1605,9 +1604,9 @@ gp_camera_start_timeout (Camera *camera, unsigned int timeout, * We remember the id here in order to automatically remove * the timeout on gp_camera_exit. */ - C_MEM (ids = realloc (camera->pc->timeout_ids, sizeof (int) * + C_MEM (camera->pc->timeout_ids = + realloc (camera->pc->timeout_ids, sizeof (int) * (camera->pc->timeout_ids_len + 1))); - camera->pc->timeout_ids = ids; id = camera->pc->timeout_start_func (camera, timeout, func, camera->pc->timeout_data); |