Fix a crash when trying to create an IPV6 socket.
--- a/model/dce-fd.cc Mon Jul 09 17:35:31 2012 +0200
+++ b/model/dce-fd.cc Mon Jul 16 11:25:39 2012 +0200
@@ -358,6 +358,13 @@
}
factory = manager->GetObject<LocalSocketFdFactory> ();
}
+ UnixFd *socket = factory->CreateSocket (domain, type, protocol);
+ if (!socket)
+ {
+
+ current->err = EINVAL;
+ return -1;
+ }
int fd = UtilsAllocateFd ();
if (fd == -1)
@@ -365,8 +372,6 @@
current->err = EMFILE;
return -1;
}
-
- UnixFd *socket = factory->CreateSocket (domain, type, protocol);
socket->IncFdCount ();
current->process->openFiles[fd] = new FileUsage (fd, socket);