Close "/dev/urandom" if we manage to open it.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Jan 2006 21:31:33 +0000 (21:31 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Jan 2006 21:31:33 +0000 (21:31 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16990 f5534014-38df-0310-8fa8-9805f1628bb7

epan/emem.c

index af602a4ad90387fa78c97221ad2cfa47318a0358..b7936e181a198fcb28f1dd353e126941ce3550a0 100644 (file)
@@ -112,6 +112,7 @@ emem_canary(guint8 *canary) {
        /* Try /dev/urandom */
        if (fp = eth_fopen("/dev/urandom", 0)) {
                sz = fread(canary, EMEM_CANARY_DATA_SIZE, 1, fd);
+               fclose(fp);
                if (sz == EMEM_CANARY_SIZE) {
                        return;
                }