diff options
author | 1991-06-20 04:46:59 +0000 | |
---|---|---|
committer | 1991-06-20 04:46:59 +0000 | |
commit | 5da50ce68ff479349c27fad610a33780d3e44998 (patch) | |
tree | 7e8aab2aeedcd148ced0f3650c63bcb9562e098a /clients/xzwrite | |
parent | 5911191e5245763c192c53140754f87a3d47be72 (diff) |
Check malloc return value.
X11R5 XtVaAppInitialize argc argument is (int *), not (Cardinal *).
Diffstat (limited to 'clients/xzwrite')
-rw-r--r-- | clients/xzwrite/interface.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/clients/xzwrite/interface.c b/clients/xzwrite/interface.c index 579baf8..a691790 100644 --- a/clients/xzwrite/interface.c +++ b/clients/xzwrite/interface.c @@ -132,13 +132,20 @@ void build_interface(argc, argv) if (! path1) path1 = ""; path2 = (char *) malloc(strlen(path1) + strlen(XZWRITE_SEARCH_PATHS) + 2); - sprintf(path2, "%s:%s", path1, XZWRITE_SEARCH_PATHS); - setenv("XFILESEARCHPATH", path2, 1); - free(path2); + if (path2 != NULL) + { + sprintf(path2, "%s:%s", path1, XZWRITE_SEARCH_PATHS); + setenv("XFILESEARCHPATH", path2, 1); + free(path2); + } } toplevel = XtVaAppInitialize(&app_con, "XZwrite", app_options, +#if XtSpecificationRelease > 4 + num_options, argc, argv, +#else num_options, (Cardinal *) argc, argv, +#endif fallback_resources, NULL); XtVaGetApplicationResources(toplevel, (XtPointer) &defs, app_resources, |