]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix valgrind errors, and report correct type.
authorRoy Marples <roy@marples.name>
Mon, 21 Jul 2008 21:48:17 +0000 (21:48 +0000)
committerRoy Marples <roy@marples.name>
Mon, 21 Jul 2008 21:48:17 +0000 (21:48 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 3d6a29d92133d94a9ecebf103102bc9e6099167d..533b29d922600dcc80ef97af1afe174b763532cc 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -295,7 +295,7 @@ get_option(const struct dhcp_message *dhcp, uint8_t opt, int *len, int *type)
        }
 
 exit:
-       if (valid_length(o, bl, type) == -1) {
+       if (valid_length(opt, bl, type) == -1) {
                errno = EINVAL;
                return NULL;
        }
@@ -583,7 +583,7 @@ decode_rfc3361(int dl, const uint8_t *data)
 char *
 get_option_string(const struct dhcp_message *dhcp, uint8_t option)
 {
-       int type;
+       int type = 0;
        int len;
        const uint8_t *p;
        char *s;