Index: libbn/anim.c
===================================================================
--- libbn/anim.c	(revision 54115)
+++ libbn/anim.c	(working copy)
@@ -628,7 +628,6 @@
     vect_t dx;
 
     VMOVE(dx, dx2);
-    sign = 1.0;
     mag = MAGNITUDE(dx);
     if (mag < VDIVIDE_TOL) {
 	bu_log("anim_dirn2mat: Need non-zero vector");
@@ -647,7 +646,6 @@
 	if (mag < VDIVIDE_TOL) {
 	    /* use default */
 	    VSET(temp, 0.0, 1.0, 0.0);
-	    mag = 1.0;
 	} else {
 	    inv = 1.0/mag;
 	    temp[0] *= inv;
Index: libbn/plane.c
===================================================================
--- libbn/plane.c	(revision 54115)
+++ libbn/plane.c	(working copy)
@@ -118,7 +118,6 @@
     }
 
     if (mag_ca > max_len) {
-	max_len = mag_ca;
 	max_edge_no = 3;
     }
 
@@ -846,12 +845,10 @@
 	if (bn_pt2_pt2_equal(a, hit_pt, tol) ||
 	    bn_pt2_pt2_equal(a, hit2, tol)) {
 	    dist[1] = 0;
-	    ret = 1;	/* Intersect is at A */
 	}
 	if (bn_pt2_pt2_equal(b, hit_pt, tol) ||
 	    bn_pt2_pt2_equal(b, hit_pt, tol)) {
 	    dist[1] = 1;
-	    ret = 2;	/* Intersect is at B */
 	}
 
 	ret = bn_isect_pt2_lseg2(&ab_dist, a, b, hit_pt, tol);
@@ -1221,12 +1218,8 @@
 	bu_bomb("bn_isect_line3_line3(): logic error, lines colinear but not parallel\n");
     }
 
-    if (parallel && !colinear) {
-	/* lines are parallel */
-	sc = d / pdir_mag_sq;
-	tc = 0.0;
+    if (parallel && !colinear)
 	return -2; /* no intersection, lines are parallel */
-    }
 
     if (parallel && colinear) {
 
Index: libbn/poly.c
===================================================================
--- libbn/poly.c	(revision 54115)
+++ libbn/poly.c	(working copy)
@@ -335,7 +335,6 @@
 
 	if (a >= 0.0) {
 	    fact = 0.0;
-	    phi = 0.0;
 	    cs_phi = 1.0;		/* cos(phi); */
 	    sn_phi_s3 = 0.0;	/* sin(phi) * SQRT3; */
 	} else {
@@ -343,7 +342,6 @@
 	    a *= -THIRD;
 	    fact = sqrt(a);
 	    if ((f = b * (-0.5) / (a*fact)) >= 1.0) {
-		phi = 0.0;
 		cs_phi = 1.0;		/* cos(phi); */
 		sn_phi_s3 = 0.0;	/* sin(phi) * SQRT3; */
 	    }  else if (f <= -1.0) {
Index: libbn/tcl.c
===================================================================
--- libbn/tcl.c	(revision 54115)
+++ libbn/tcl.c	(working copy)
@@ -871,7 +871,7 @@
 		for (xval = 0; xval < xdim; xval++) {
 		    pt[X] = xval * scale[X] + delta[X];
 
-		    val = bn_noise_fbm(pt, h_val, lacunarity, octaves);
+		    bn_noise_fbm(pt, h_val, lacunarity, octaves);
 
 		}
 	    }
Index: libbn/tri_tri.c
===================================================================
--- libbn/tri_tri.c	(revision 54115)
+++ libbn/tri_tri.c	(working copy)
@@ -390,7 +390,7 @@
     bb=(float)FABS(D[1]);
     cc=(float)FABS(D[2]);
     if (bb>max) max=bb, index=1;
-    if (cc>max) max=cc, index=2;
+    if (cc>max) index=2;
 
     /* this is the simplified projection onto L*/
     vp0=V0[index];
@@ -551,7 +551,7 @@
     b=fabs(D[1]);
     c=fabs(D[2]);
     if (b>max) max=b, index=1;
-    if (c>max) max=c, index=2;
+    if (c>max) index=2;
 
     /* this is the simplified projection onto L*/
     vp0=V0[index];
Index: libbu/color.c
===================================================================
--- libbu/color.c	(revision 54115)
+++ libbu/color.c	(working copy)
@@ -186,11 +186,11 @@
     if (*str == '#') {
 	if (strlen(++str) != 6)
 	    return 0;
-	num = sscanf(str, "%02x%02x%02x", (unsigned int *)&r, (unsigned int *)&g, (unsigned int *)&b);
+	sscanf(str, "%02x%02x%02x", (unsigned int *)&r, (unsigned int *)&g, (unsigned int *)&b);
     } else if (isdigit((int)(*str))) {
 	num = sscanf(str, "%d/%d/%d", &r, &g, &b);
 	if (num == 1) {
-	    num = sscanf(str, "%d %d %d", &r, &g, &b);
+	    sscanf(str, "%d %d %d", &r, &g, &b);
 	}
 	VSET(rgb, r, g, b);
 	if ((r < 0) || (r > 255)
Index: libbu/fnmatch.c
===================================================================
--- libbu/fnmatch.c	(revision 54115)
+++ libbu/fnmatch.c	(working copy)
@@ -217,7 +217,6 @@
 	c = *pattern++; /* next */
     }
     c = *pattern++;
-    if (c != ']') resultholder = -1;
     bu_vls_strncpy(&classname, pattern-counter-2, counter);
 
     ctclass = findclass(bu_vls_addr(&classname));
Index: libbu/hash.c
===================================================================
--- libbu/hash.c	(revision 54115)
+++ libbu/hash.c	(working copy)
@@ -34,7 +34,6 @@
     unsigned long hash = 5381;
     int i, c;
 
-    c = *str;
     for (i=0; i<len; i++) {
 	c = *str;
 	hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
Index: libbu/mappedfile.c
===================================================================
--- libbu/mappedfile.c	(revision 54115)
+++ libbu/mappedfile.c	(working copy)
@@ -269,7 +269,6 @@
 	bu_semaphore_acquire(BU_SEM_SYSCALL);
 	(void)close(fd);
 	bu_semaphore_release(BU_SEM_SYSCALL);
-	fd = -1;
     }
 
     mp->uses = 1;
@@ -292,7 +291,6 @@
 	bu_semaphore_acquire(BU_SEM_SYSCALL);
 	(void)close(fd);
 	bu_semaphore_release(BU_SEM_SYSCALL);
-	fd = -1;
     }
 
     if (mp) {
Index: util/asc-pl.c
===================================================================
--- util/asc-pl.c	(revision 54115)
+++ util/asc-pl.c	(working copy)
@@ -62,10 +62,10 @@
     char buf[BUF_LEN];
     char sarg[BUF_LEN];
     static char *fm[] = { "r", "w" };
-    double darg[6];
+    double darg[6] = {0.0};
     static FILE *fp[2];
     int i;
-    int iarg[6];
+    int iarg[6] = {0};
     int line_nm;
     int nm_args = 0;
 
Index: util/bary.c
===================================================================
--- util/bary.c	(revision 54115)
+++ util/bary.c	(working copy)
@@ -174,7 +174,6 @@
 
     switch (argc - bu_optind) {
 	case 0:
-	    inf_name = "stdin";
 	    infp = stdin;
 	    break;
 	case 1:
Index: util/bwmod.c
===================================================================
--- util/bwmod.c	(revision 54115)
+++ util/bwmod.c	(working copy)
@@ -183,7 +183,7 @@
 		case OR  : tmp=d; tmp |= (int)val[i]; d=tmp;break;
 		case AND : tmp=d; tmp &= (int)val[i]; d=tmp;break;
 		case XOR : tmp=d; tmp ^= (int)val[i]; d= tmp; break;
-		case TRUNC: tmp=((int)d/(int)val[i])*(int)val[i]; break;
+		/* case TRUNC: tmp=((int)d/(int)val[i])*(int)val[i]; break; */
 		default  : fprintf(stderr, "%s: error in op\n", progname);
 		    bu_exit (-1, NULL);
 		    break;
Index: util/bwscale.c
===================================================================
--- util/bwscale.c	(revision 54115)
+++ util/bwscale.c	(working copy)
@@ -412,7 +412,7 @@
     outbuf = (unsigned char *)bu_malloc(i, "outbuf");
 
     /* Here we go */
-    i = scale(stdout, inx, iny, outx, outy);
+    scale(stdout, inx, iny, outx, outy);
 
     bu_free(outbuf, (const char *)buffer);
     bu_free(buffer, (const char *)buffer);
Index: util/bwshrink.c
===================================================================
--- util/bwshrink.c	(revision 54115)
+++ util/bwshrink.c	(working copy)
@@ -86,9 +86,8 @@
     p = buffer;
 
     for (y=0; y < h; y += Factor)
-	for (x=0; x < w; x += Factor, p++) {
+	for (x=0; x < w; x += Factor, p++)
 	    p[0] = buffer[x + y * w];
-	}
 }
 
 
@@ -188,6 +187,7 @@
     if ((buffer = (unsigned char *)malloc(width*height)) == (unsigned char *)NULL) {
 	fprintf(stderr, "%s: cannot allocate input buffer\n",
 		      progname);
+        bu_free(buffer, "buffer alloc from malloc");
 	bu_exit (-1, NULL);
     }
 
@@ -196,6 +196,8 @@
 	/* do nothing */;
     }
 
+    bu_free(buffer, "buffer alloc from malloc");
+
     if (c < 0) {
 	perror (filename);
 	return -1;
@@ -211,6 +213,8 @@
     for (t=0; t < size && (c=write(1, (char *)&buffer[t], size-t)) >= 0;
 	 t += c);
 
+    bu_free(buffer, "buffer alloc from malloc");
+
     if (c < 0) {
 	perror("stdout");
 	return -1;
Index: util/imgdims.c
===================================================================
--- util/imgdims.c	(revision 54115)
+++ util/imgdims.c	(working copy)
@@ -132,9 +132,10 @@
     }
 
     argument = bu_realpath(argv[bu_optind], NULL);
-    if (!bu_file_exists(argument, NULL))
+    if (!bu_file_exists(argument, NULL)) {
 	bu_free(argument, "argument realpath");
 	bu_exit(1, "image file [%s] does not exist\n", argument);
+    }
 
     if ((stat(argument, &stat_buf) != 0)
 	&& (!grab_number(argument, &nm_bytes)))
Index: util/pix-alias.c
===================================================================
--- util/pix-alias.c	(revision 54115)
+++ util/pix-alias.c	(working copy)
@@ -81,7 +81,7 @@
     for (n=y-1; n >= 0; --n)
 	if (fread(&image[n*x*3], x*3, 1, stdin) != 1) {
 	    (void) fprintf(stderr, "Error reading image at scanline %u\n", n);
-	    free(image);
+	    bu_free(image, "image alloc from malloc");
 	    bu_exit (-2, NULL);
 	}
 
@@ -122,7 +122,7 @@
 	(void) putchar(image[cpix+1]);
 	(void) putchar(image[cpix]);
     }
-    free(image);
+    bu_free(image, "image alloc from malloc");
 }
 
 
Index: util/pix-orle.c
===================================================================
--- util/pix-orle.c	(revision 54115)
+++ util/pix-orle.c	(working copy)
@@ -153,8 +153,10 @@
     rle_wpos(0, 0, 1);		/* Start position is origin */
 
     /* Write RLE header, ncolors=3, bgflag=0 */
-    if (rle_whdr(outfp, 3, 0, 0, RGBPIXEL_NULL) == -1)
+    if (rle_whdr(outfp, 3, 0, 0, RGBPIXEL_NULL) == -1) {
+        bu_free(scan_buf, "scan_buf alloc form malloc");
 	return 1;
+    }
 
     /* Read image a scanline at a time, and encode it */
     for (y = 0; y < file_height; y++) {
@@ -163,13 +165,18 @@
 	ret = fread((char *)scan_buf, sizeof(RGBpixel), file_width, infp);
 	if (ret != file_width) {
 	    (void) fprintf(stderr, "read of %lu pixels on line %lu failed!\n", (unsigned long)file_width, (unsigned long)y);
+            bu_free(scan_buf, "scan_buf alloc form malloc");
 	    return 1;
 	}
 
-	if (rle_encode_ln(outfp, scan_buf) == -1)
+	if (rle_encode_ln(outfp, scan_buf) == -1) {
+            bu_free(scan_buf, "scan_buf alloc form malloc");
 	    return 1;
+        }
     }
 
+    bu_free(scan_buf, "scan_buf alloc form malloc");
+
     fclose(infp);
     fclose(outfp);
     return 0;
Index: util/pixbackgnd.c
===================================================================
--- util/pixbackgnd.c	(revision 54115)
+++ util/pixbackgnd.c	(working copy)
@@ -323,6 +323,9 @@
 	    flood(horiz_buf, vert_buf, vp, line);
     }
 
+    bu_free(horiz_buf, "horiz_buf alloc from malloc");
+    bu_free(vp, "vp");
+
     return 0;
 }
 
Index: util/pixclump.c
===================================================================
--- util/pixclump.c	(revision 54115)
+++ util/pixclump.c	(working copy)
@@ -209,7 +209,6 @@
 	}
     switch (argc - bu_optind) {
 	case 0:
-	    inf_name = "stdin";
 	    infp = stdin;
 	    /* Break intentionally missing */
 	case 1:
Index: util/pixcount.c
===================================================================
--- util/pixcount.c	(revision 54115)
+++ util/pixcount.c	(working copy)
@@ -198,11 +198,9 @@
 	}
     switch (argc - bu_optind) {
 	case 0:
-	    inf_name = "stdin";
 	    infp = stdin;
 	    /* Break intentionally missing */
 	case 1:
-	    outf_name = "stdout";
 	    outfp = stdout;
 	    /* Break intentionally missing */
 	case 2:
Index: util/pixcut.c
===================================================================
--- util/pixcut.c	(revision 54115)
+++ util/pixcut.c	(working copy)
@@ -317,7 +317,7 @@
     }
 
     while (row < base_y) {
-	result = fread(inbuf, num_bytes, org_width, input);
+	fread(inbuf, num_bytes, org_width, input);
 	row++;
     }
 /*
Index: util/pixdsplit.c
===================================================================
--- util/pixdsplit.c	(revision 54115)
+++ util/pixdsplit.c	(working copy)
@@ -118,7 +118,6 @@
      */
     switch (argc - bu_optind) {
 	case 0:
-	    inf_name = "stdin";
 	    infd = 0;
 	    break;
 	case 1:
Index: util/pixfields.c
===================================================================
--- util/pixfields.c	(revision 54115)
+++ util/pixfields.c	(working copy)
@@ -145,6 +145,8 @@
 	line_number++;
     }
 
+    bu_free(line2, "line2 alloc from malloc");
+
     return 0;
 }
 
Index: util/pixinterp2x.c
===================================================================
--- util/pixinterp2x.c	(revision 54115)
+++ util/pixinterp2x.c	(working copy)
@@ -136,6 +136,7 @@
 	    interp_lines(outy-1, outy, outy-2);
     }
     ret = write(1, (char *)outbuf, outsize);
+    bu_free(inbuf, "inbuf alloc from malloc");
     if (ret != outsize) {
 	perror("pixinterp2x write");
 	bu_exit (1, NULL);
Index: util/pixmorph.c
===================================================================
--- util/pixmorph.c	(revision 54115)
+++ util/pixmorph.c	(working copy)
@@ -482,6 +482,11 @@
     if (pa == NULL || pb == NULL || wa == NULL ||  wb == NULL ||
 	morph == NULL) {
 	fprintf(stderr, "pixmorph: memory allocation failure\n");
+        bu_free(pa, "pa alloc from malloc");
+        bu_free(pb, "pb alloc from malloc");
+        bu_free(wa, "wa alloc from malloc");
+        bu_free(wb, "wb alloc from malloc");
+        bu_free(morph, "morph alloc from malloc");
 	return 1;
     }
 
Index: util/pixscale.c
===================================================================
--- util/pixscale.c	(revision 54115)
+++ util/pixscale.c	(working copy)
@@ -430,7 +430,7 @@
     outbuf = bu_malloc(i, "outbuf");
 
     /* Here we go */
-    i = scale(stdout, inx, iny, outx, outy);
+    scale(stdout, inx, iny, outx, outy);
     bu_free(outbuf, "outbuf");
     bu_free(buffer, "buffer");
     return 0;
Index: util/pixshrink.c
===================================================================
--- util/pixshrink.c	(revision 54115)
+++ util/pixshrink.c	(working copy)
@@ -153,6 +153,8 @@
 	    p[1] = buffer[t+1];
 	    p[2] = buffer[t+2];
 	}
+
+    bu_free(p, "p");
 }
 
 
@@ -250,9 +252,8 @@
 
     switch (method) {
 	case METH_BOXCAR : shrink_image(scanlen, width, height, buffer, factor); break;
-	case METH_UNDERSAMPLE : usample_image(scanlen, width, height, buffer, factor);
-	    break;
-	default: return -1;
+	case METH_UNDERSAMPLE : usample_image(scanlen, width, height, buffer, factor); break;
+	default: bu_free(buffer, "buffer alloc from malloc"); return -1;
     }
 
     write_image(width/factor, height/factor, buffer);
Index: util/pixtile.c
===================================================================
--- util/pixtile.c	(revision 54115)
+++ util/pixtile.c	(working copy)
@@ -223,6 +223,8 @@
 	    perror("write");
     }
 
+    bu_free(obuf, "obuf alloc from malloc");
+
     fprintf(stderr, "\n");
 
     return 0;
Index: util/plrot.c
===================================================================
--- util/plrot.c	(revision 54115)
+++ util/plrot.c	(working copy)
@@ -278,9 +278,9 @@
 		verbose++;
 		break;
 	    case 'S':
-		num = sscanf(bu_optarg, "%lf %lf %lf %lf %lf %lf",
-			     &mtmp[0], &mtmp[1], &mtmp[2],
-			     &mtmp[3], &mtmp[4], &mtmp[5]);
+		sscanf(bu_optarg, "%lf %lf %lf %lf %lf %lf",
+                       &mtmp[0], &mtmp[1], &mtmp[2],
+		       &mtmp[3], &mtmp[4], &mtmp[5]);
 		VSET(forced_space_min, mtmp[0], mtmp[1], mtmp[2]);
 		VSET(forced_space_max, mtmp[3], mtmp[4], mtmp[5]);
 
Index: util/sun-pix.c
===================================================================
--- util/sun-pix.c	(revision 54115)
+++ util/sun-pix.c	(working copy)
@@ -364,7 +364,6 @@
     }
 
     width = header.ras_width;
-    x = 0;
 
     switch (header.ras_depth) {
 	case 1:
@@ -440,7 +439,7 @@
 	    while ((header.ras_type == RT_BYTE_ENCODED) ?
 		   decoderead(buf, sizeof(*buf), scanbytes, fp) :
 		   fread(buf, sizeof(*buf), scanbytes, fp)) {
-		for (x=0; x < width; x++) {
+		for (x = 0; x < width && x < (int)sizeof(*buf); x++) {
 		    cmap_idx = buf[x];
 		    if (cmap_idx >= CMAP_MAX_INDEX) {
 			bu_log("Warning: Read invalid index %u.\n",
Index: util/ttcp.c
===================================================================
--- util/ttcp.c	(revision 54115)
+++ util/ttcp.c	(working copy)
@@ -67,7 +67,6 @@
 #  include <sys/resource.h>
 #endif
 
-
 struct sockaddr_in sinme;
 struct sockaddr_in sinhim;
 struct sockaddr_in sindum;
@@ -658,6 +657,7 @@
 	(void)Nwrite(fd, buf, 4); /* rcvr end */
 	(void)Nwrite(fd, buf, 4); /* rcvr end */
     }
+    free(buf);
     fprintf(stderr, "ttcp%s: %s\n", trans?"-t":"-r", stats);
     if (cput <= 0.0) cput = 0.001;
     if (realt <= 0.0) realt = 0.001;
