comparison src/video/x11/SDL_x11video.c @ 2323:4ac07ae446d3

Fixed many valgrind errors. But, I broke testdyngl.
author Bob Pendleton <bob@pendleton.com>
date Thu, 06 Mar 2008 23:07:02 +0000
parents fbe8ff44c519
children 3202e4826c57
comparison
equal deleted inserted replaced
2322:c25d45b7add3 2323:4ac07ae446d3
118 return NULL; 118 return NULL;
119 } 119 }
120 120
121 /* Initialize all variables that we clean on shutdown */ 121 /* Initialize all variables that we clean on shutdown */
122 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); 122 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
123 if (device) { 123 if (!device) {
124 data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
125 }
126 if (!device || !data) {
127 SDL_OutOfMemory(); 124 SDL_OutOfMemory();
128 if (device) { 125 return NULL;
129 SDL_free(device); 126 }
130 } 127 data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
128 if (!data) {
129 SDL_OutOfMemory();
130 SDL_free(device);
131 return NULL; 131 return NULL;
132 } 132 }
133 device->driverdata = data; 133 device->driverdata = data;
134 134
135 /* FIXME: Do we need this? 135 /* FIXME: Do we need this?