]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
Refresh of dup2
authorSean Hefty <sean.hefty@intel.com>
Mon, 6 Aug 2012 22:20:06 +0000 (15:20 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 6 Aug 2012 22:20:06 +0000 (15:20 -0700)
src/preload.c

index ff7d2d0927946283bd015b2a1fdfc5c9fcd6090c..b3cf6acc7c1319bf01b8f21cb260c15a2b9adf53 100644 (file)
@@ -815,6 +815,7 @@ int shutdown(int socket, int how)
 int close(int socket)
 {
        struct fd_info *fdi;
+       int ret;
 
        init_preload();
        fdi = idm_lookup(&idm, socket);
@@ -933,7 +934,7 @@ int dup2(int oldfd, int newfd)
        if (!oldfdi || ret != newfd)
                return ret;
 
-       newfdi = calloc(1, sizeof *fdi);
+       newfdi = calloc(1, sizeof *newfdi);
        if (!newfdi) {
                close(newfd);
                return ERR(ENOMEM);