projects
/
platform
/
upstream
/
v4l-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e4d225
)
get_medida_devices: use strdup
author
Hans de Goede
<hdegoede@redhat.com>
Sat, 18 Jun 2011 11:39:40 +0000
(13:39 +0200)
committer
Hans de Goede
<hdegoede@redhat.com>
Sat, 18 Jun 2011 13:31:37 +0000
(15:31 +0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
utils/libmedia_dev/get_media_devices.c
patch
|
blob
|
history
diff --git
a/utils/libmedia_dev/get_media_devices.c
b/utils/libmedia_dev/get_media_devices.c
index
65fca6e
..
612709d
100644
(file)
--- a/
utils/libmedia_dev/get_media_devices.c
+++ b/
utils/libmedia_dev/get_media_devices.c
@@
-162,10
+162,8
@@
static int get_class(char *class,
/* Cleans previous data and fills it with device/node */
memset(md_ptr, 0, sizeof(*md_ptr));
md_ptr->type = UNKNOWN;
- md_ptr->device = malloc(strlen(device) + 1);
- strcpy(md_ptr->device, device);
- md_ptr->node = malloc(strlen(entry->d_name) + 1);
- strcpy(md_ptr->node, entry->d_name);
+ md_ptr->device = strdup(device);
+ md_ptr->node = strdup(entry->d_name);
/* Retrieve major and minor information */
get_uevent_info(md_ptr, dname);