[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torsocks/master] Fix funny malloc statement



commit f8c2e64899efc569b61922235de8be4dd893e67c
Author: Robert Hogan <robert@xxxxxxxxxxxxxxx>
Date:   Sun Feb 27 12:21:17 2011 +0000

    Fix funny malloc statement
---
 src/parser.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/parser.c b/src/parser.c
index c7c6290..8f24be6 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -266,7 +266,7 @@ static int handle_path(struct parsedfile *config, int lineno, int nowords, char
     } else {
         /* Open up a new serverent, put it on the list   */
         /* then set the current context                  */
-        if (((int) (newserver = (struct serverent *) malloc(sizeof(struct serverent)))) == -1)
+        if ((newserver = malloc(sizeof(*newserver))) == NULL)
             exit(-1);
 
         /* Initialize the structure */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits