Blob Blame History Raw
--- GMT4.3.0/src/psxyz.c.segfault	2008-04-30 21:00:39.000000000 -0600
+++ GMT4.3.0/src/psxyz.c	2008-05-06 09:10:31.000000000 -0600
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------
- *	$Id: psxyz.c,v 1.130 2008/05/01 03:00:39 guru Exp $
+ *	$Id: psxyz.c,v 1.131 2008/05/06 04:03:12 guru Exp $
  *
  *	Copyright (c) 1991-2008 by P. Wessel and W. H. F. Smith
  *	See COPYING file for copying and redistribution conditions.
@@ -549,6 +549,7 @@
 				data1[n].flag = 0;
 				data1[n].lon = in[0];
 				data1[n].lat = in[1];
+				data1[n].string = NULL;
 				if (S.read_vector) {
 					data1[n].x_size = (float)in[three];	/* direction */
 					data1[n].y_size = (float)(in[four] * GMT_u2u[S.u][GMT_INCH]);	/* length */
@@ -824,6 +825,7 @@
 							GMT_text3D (data1[i].x, data1[i].y, data1[i].z, font_size, S.font_no, data1[i].string, 0.0, 6, FALSE);
 						else
 							GMT_text3D (data1[i].x, data1[i].y, data1[i].z, font_size, S.font_no, data1[i].string, 0.0, 6, TRUE);
+						GMT_free ((void *)data1[i].string);
 						break;
 					case GMT_SYMBOL_VECTOR:
 						if (data1[i].flag & 2) {
@@ -923,7 +925,6 @@
 						GMT_draw_custom_symbol (data1[i].x, data1[i].y, data1[i].z, (double)data1[i].x_size, S.custom, &current_pen, &current_fill, data1[i].outline);
 						break;
 				}
-				if (data1[i].string) GMT_free ((void *)data1[i].string);
 			}
 			GMT_free ((void *)data1);
 		}
--- GMT4.3.0/src/project.c.segfault	2008-04-30 21:00:39.000000000 -0600
+++ GMT4.3.0/src/project.c	2008-05-06 10:32:43.000000000 -0600
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------
- *	$Id: project.c,v 1.57 2008/05/01 03:00:39 guru Exp $
+ *	$Id: project.c,v 1.58 2008/05/06 04:03:12 guru Exp $
  *
  *	Copyright (c) 1991-2008 by P. Wessel and W. H. F. Smith
  *	See COPYING file for copying and redistribution conditions.
@@ -484,8 +484,7 @@
 
 	/*  Now we are ready to work  */
 
-	n_used = 0;
-	n_total_read = 0;
+	n_used = n_total_read = 0;
 
 	if (Ctrl->G.active) {	/* Not input data expected, just generate track from arguments given */
 		n_outputs = 3;
@@ -497,6 +496,8 @@
 		d_along = Ctrl->L.min;
 		while ((Ctrl->L.max - d_along) > (GMT_CONV_LIMIT*Ctrl->G.inc)) {
 			p_data[n_used].a[2] = d_along;
+			p_data[n_used].t = NULL;	/* Initialize since that is not done by realloc */
+			p_data[n_used].z = NULL;	/* Initialize since that is not done by realloc */
 			n_used++;
 			d_along = Ctrl->L.min + n_used * Ctrl->G.inc;
 			if (n_used == (n_alloc-1)) {
@@ -505,6 +506,8 @@
 			}
 		}
 		p_data[n_used].a[2] = Ctrl->L.max;
+		p_data[n_used].t = NULL;	/* Initialize since that is not done by realloc */
+		p_data[n_used].z = NULL;	/* Initialize since that is not done by realloc */
 		n_used ++;
 
 		/* We need to find r,s  */
@@ -643,6 +646,8 @@
 					p_data[n_used].a[1] = yy;
 					p_data[n_used].a[2] = xt[0];
 					p_data[n_used].a[3] = xt[1];
+					p_data[n_used].t = NULL;	/* Initialize since that is not done by realloc */
+					p_data[n_used].z = NULL;	/* Initialize since that is not done by realloc */
 					if (n_z) {	/* Copy over z column(s) */
 						if (pure_ascii) {	/* Must store all text beyond x,y columns */
 							p_data[n_used].t = (char *) GMT_memory (VNULL, strlen (GMT_io.current_record), sizeof (char), GMT_program);