p_s = strtok_r (my_ld_library_path, ":", &ptrptr);
while (p_s != NULL) {
- path_list[path_list_entries++] = strdup (p_s);
+ char *p = strdup (p_s);
+ if (p) {
+ path_list[path_list_entries++] = p;
+ }
p_s = strtok_r (NULL, ":", &ptrptr);
}
}
while (fgets (string, sizeof (string), fp)) {
+ char *p;
if (strlen(string) > 0)
string[strlen(string) - 1] = '\0';
if (strncmp (string, "include", strlen ("include")) == 0) {
ldso_path_build (newpath, new_filename);
continue;
}
- path_list[path_list_entries++] = strdup (string);
+ p = strdup (string);
+ if (p) {
+ path_list[path_list_entries++] = p;
+ }
}
fclose(fp);
#endif