aboutsummaryrefslogtreecommitdiff
path: root/lib/nwlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nwlib.c')
-rw-r--r--lib/nwlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/nwlib.c b/lib/nwlib.c
index 27e33e472..290cbe31f 100644
--- a/lib/nwlib.c
+++ b/lib/nwlib.c
@@ -184,7 +184,8 @@ int GetOrSetUpData(int id, libdata_t **appData,
*/
NXLock(gLibLock);
- if(!(app_data = (libdata_t *) get_app_data(id))) {
+ app_data = (libdata_t *) get_app_data(id);
+ if(!app_data) {
app_data = malloc(sizeof(libdata_t));
if(app_data) {
@@ -259,7 +260,8 @@ int GetOrSetUpData(int id, libdata_t **appData,
err = ENOMEM;
}
- if((err = NXKeySetValue(key, thread_data))) {
+ err = NXKeySetValue(key, thread_data);
+ if(err) {
free(thread_data->twentybytes);
free(thread_data);
thread_data = (libthreaddata_t *) NULL;