]> arthur.barton.de Git - netatalk.git/commitdiff
Fix possible uninitialized useds
authorFrank Lahm <franklahm@googlemail.com>
Tue, 18 Jan 2011 09:54:31 +0000 (10:54 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 18 Jan 2011 09:54:31 +0000 (10:54 +0100)
libatalk/acl/cache.c
libatalk/util/socket.c

index 854c10d95ea53fc04bedaab7f914d04c3a346d71..7613880ba35fb236a845cabb7f65c0f2204c8bd6 100644 (file)
@@ -121,7 +121,7 @@ static unsigned char hashuuid(uuidp_t uuid) {
 int add_cachebyname( const char *inname, const uuidp_t inuuid, const uuidtype_t type, const unsigned long uid _U_) {
     int ret = 0;
     char *name = NULL;
-    uuidp_t uuid;
+    uuidp_t uuid = NULL;
     cacheduser_t *cacheduser = NULL;
     unsigned char hash;
 
@@ -319,7 +319,7 @@ int search_cachebyuuid( uuidp_t uuidp, char **name, uuidtype_t *type) {
 int add_cachebyuuid( uuidp_t inuuid, const char *inname, uuidtype_t type, const unsigned long uid _U_) {
     int ret = 0;
     char *name = NULL;
-    uuidp_t uuid;
+    uuidp_t uuid = NULL;
     cacheduser_t *cacheduser = NULL;
     cacheduser_t *entry;
     unsigned char hash;
index 96472baec78302486f0c72b0d14e807e2a4b418d..f29f3837054f44ae0bf718b8ee25e0d745253795 100644 (file)
@@ -81,14 +81,12 @@ int setnonblock(int fd, int cmd)
  */
 ssize_t readt(int socket, void *data, const size_t length, int setnonblocking, int timeout)
 {
-    size_t stored;
-    ssize_t len;
+    size_t stored = 0;
+    ssize_t len = 0;
     struct timeval now, end, tv;
     fd_set rfds;
     int ret;
 
-    stored = 0;
-
     if (setnonblocking) {
         if (setnonblock(socket, 1) != 0)
             return -1;