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:
@@ -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:
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user