]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix coverity errors
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:29:57 +0000 (13:29 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:31:57 +0000 (13:31 -0500)
scripts/jlibtool.c

index a34a5d5ba4a6df07978acead5872d9276fe736f0..b0bc2ae21a289abf79ae4ecd64a4cd5051f293e2 100644 (file)
@@ -651,7 +651,7 @@ static int parse_long_opt(char *arg, command_t *cmd_data)
     if (equal_pos) {
         strncpy(var, arg, equal_pos - arg);
         var[equal_pos - arg] = 0;
-        strcpy(value, equal_pos + 1);
+        strlcpy(value, equal_pos + 1, sizeof(var));
     } else {
         strncpy(var, arg, sizeof(var) - 1);
         var[sizeof(var) - 1] = '\0';
@@ -1270,6 +1270,7 @@ static void add_rpath_file(count_chars *cc, const char *arg)
     path = load_install_path(arg);
     if (path) {
         add_rpath(cc, path);
+       free(path);
     }
 }
 
@@ -2363,6 +2364,7 @@ static void cleanup_tmp_dir(const char *dirname)
 
     if ((strlen(dirname) + 1 + sizeof(entry->d_name)) >= sizeof(fullname)) {
           fprintf(stderr, "Dirname too long out of buffer space");
+         (void) closedir(dir);
           return;
     }