projects
/
netresolve.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a15983e
)
fix services.c segfault
author
Pavel Šimerda <psimerda@redhat.com>
Sat, 8 Feb 2014 15:47:47 +0000
(16:47 +0100)
committer
Pavel Šimerda <psimerda@redhat.com>
Sat, 8 Feb 2014 15:47:47 +0000
(16:47 +0100)
lib/services.c
patch
|
blob
|
history
diff --git
a/lib/services.c
b/lib/services.c
index 67c900475dea6ee4d888bef74d80937143e80d31..71fb777e54f330d8be634a111f5c3327d33a6877 100644
(file)
--- a/
lib/services.c
+++ b/
lib/services.c
@@
-79,7
+79,8
@@
add_service(int protocol, int port, const char *name)
memset(&service, 0, sizeof service);
service.protocol = protocol;
service.port = port;
- service.name = strdup(name);
+ if (name)
+ service.name = strdup(name);
if (servicecount == servicereservedcount) {
if (!servicereservedcount)
@@
-155,7
+156,7
@@
read_services(void)
}
out:
close(fd);
- add_service(0, 0,
""
);
+ add_service(0, 0,
NULL
);
servicereservedcount = servicecount;
services = realloc(services, servicereservedcount * sizeof *services);
}
This page took
0.066098 seconds
and
5
git commands to generate.