summaryrefslogtreecommitdiff
path: root/x11/xedit/files/patch-util.c
diff options
context:
space:
mode:
authorNiclas Zeising <zeising@FreeBSD.org>2019-09-14 10:33:59 +0000
committerNiclas Zeising <zeising@FreeBSD.org>2019-09-14 10:33:59 +0000
commit7c492f5ab81c6a908d023aaf8706a2116ef10739 (patch)
tree36c5b0dabce2ae1a0596a73fb956ee06dc0cd1f1 /x11/xedit/files/patch-util.c
parentUpdate qaudiosonar to v1.6.1. (diff)
x11/xedit: Fix segfault with missing tags file
Diffstat (limited to 'x11/xedit/files/patch-util.c')
-rw-r--r--x11/xedit/files/patch-util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/x11/xedit/files/patch-util.c b/x11/xedit/files/patch-util.c
new file mode 100644
index 000000000000..22ec83b7c17c
--- /dev/null
+++ b/x11/xedit/files/patch-util.c
@@ -0,0 +1,27 @@
+--- util.c.orig 2015-02-21 21:42:33 UTC
++++ util.c
+@@ -506,13 +506,14 @@ ResolveName(char *filename)
+
+ if (result == NULL && errno == ENOENT) {
+ int length;
+- char *dir, *file;
++ char *dir, *file, *fname;
+
+ length = strlen(filename);
+ tmp = dir = XtMalloc(length + 1);
+ strcpy(dir, filename);
++ fname = strdup(filename);
+
+- file = basename(filename);
++ file = basename(fname);
+ dir = dirname(tmp);
+
+ /* Creating a new file? */
+@@ -526,6 +527,7 @@ ResolveName(char *filename)
+ }
+
+ XtFree(tmp);
++ free(fname);
+ }
+
+ return (result);