2001-08-29 Lutz M�ller <urc8@rz.uni-karlsruhe.de>

Another patch from Ilya Konstantinov <future@shiny.co.il>:

        * libgphoto2/camera.c (gp_camera_new): Correctly initialize the speed
        to 0


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2106 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Lutz Mueller
2001-08-28 05:41:27 +00:00
parent c118e3b640
commit 5bbd164d9b
2 changed files with 25 additions and 6 deletions

View File

@@ -1,3 +1,10 @@
2001-08-29 Lutz Müller <urc8@rz.uni-karlsruhe.de>
Another patch from Ilya Konstantinov <future@shiny.co.il>:
* libgphoto2/camera.c (gp_camera_new): Correctly initialize the speed
to 0
2001-08-28 Lutz Müller <urc8@rz.uni-karlsruhe.de>
* camlibs/canon/psa50.c:

View File

@@ -61,20 +61,32 @@ gp_camera_new (Camera **camera)
return (GP_ERROR_NO_MEMORY);
/* Initialize the members */
(*camera)->port = (CameraPortInfo*)malloc(sizeof(CameraPortInfo));
if (!(*camera)->port)
(*camera)->port = malloc (sizeof(CameraPortInfo));
if (!(*camera)->port) {
free (*camera);
return (GP_ERROR_NO_MEMORY);
}
(*camera)->port->type = GP_PORT_NONE;
strcpy ((*camera)->port->path, "");
(*camera)->abilities = (CameraAbilities*)malloc(sizeof(CameraAbilities));
(*camera)->functions = (CameraFunctions*)malloc(sizeof(CameraFunctions));
(*camera)->port->speed = 0;
(*camera)->abilities = malloc(sizeof(CameraAbilities));
if (!(*camera)->abilities) {
free ((*camera)->port);
free (*camera);
return (GP_ERROR_NO_MEMORY);
}
(*camera)->functions = malloc(sizeof(CameraFunctions));
if (!(*camera)->functions) {
free ((*camera)->port);
free ((*camera)->abilities);
free (*camera);
return (GP_ERROR_NO_MEMORY);
}
(*camera)->library_handle = NULL;
(*camera)->camlib_data = NULL;
(*camera)->frontend_data = NULL;
(*camera)->session = glob_session_camera++;
(*camera)->ref_count = 1;
if (!(*camera)->abilities || !(*camera)->functions)
return (GP_ERROR_NO_MEMORY);
/* Initialize function pointers to NULL.*/
memset((*camera)->functions, 0, sizeof (CameraFunctions));