object *name, *dir;
ALport port;
ALconfig config = NULL;
- int size = gettuplesize(args);
+ int size;
+ if (args == NULL || !is_tupleobject(args)) {
+ err_badarg();
+ return NULL;
+ }
+ size = gettuplesize(args);
if (size == 2) {
if (!getstrstrarg (args, &name, &dir))
return NULL;
port = ALopenport(getstringvalue(name), getstringvalue(dir), config);
+ if (port == NULL) {
+ err_errno(RuntimeError);
+ return NULL;
+ }
+
return newportobject (port);
}
if (!getnoarg (args)) return NULL;
config = ALnewconfig ();
+ if (config == NULL) {
+ err_errno(RuntimeError);
+ return NULL;
+ }
return newconfigobject (config);
}
setlistitem(list, i, newintobject(PVbuffer[i]));
}
+ DEL(PVbuffer);
+
INCREF(None);
return None;
}