aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/windows/src/native
diff options
context:
space:
mode:
authorelias <[email protected]>2006-08-09 08:38:58 +0000
committerelias <[email protected]>2006-08-09 08:38:58 +0000
commit65cf1b9a9fade94ff81e3dafc71ad584e9ecc170 (patch)
treef1316edd9146e290fd5cb17b6c0bdb57f994135a /plugins/windows/src/native
parent6a6d9ba9daeae25f0184cfe1cc534724a3ec2430 (diff)
Check for NULL malloc result
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@159 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/windows/src/native')
-rw-r--r--plugins/windows/src/native/dx8/net_java_games_input_IDirectInputDevice.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/windows/src/native/dx8/net_java_games_input_IDirectInputDevice.c b/plugins/windows/src/native/dx8/net_java_games_input_IDirectInputDevice.c
index 11e7141..9f29191 100644
--- a/plugins/windows/src/native/dx8/net_java_games_input_IDirectInputDevice.c
+++ b/plugins/windows/src/native/dx8/net_java_games_input_IDirectInputDevice.c
@@ -352,6 +352,8 @@ JNIEXPORT jint JNICALL Java_net_java_games_input_IDirectInputDevice_nGetDeviceDa
return -1;
data = (DIDEVICEOBJECTDATA *)malloc(num_events*sizeof(DIDEVICEOBJECTDATA));
+ if (data == NULL)
+ return -1;
res = IDirectInputDevice8_GetDeviceData(lpDevice, sizeof(DIDEVICEOBJECTDATA), data, &num_events, flags);
if (res == DI_OK || res == DI_BUFFEROVERFLOW) {