mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
Fix some leaks in error cases
This commit is contained in:
parent
8669fd03a6
commit
c2028a1695
9 changed files with 43 additions and 22 deletions
|
|
@ -442,10 +442,6 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strstr(media_class, "Source") != NULL) {
|
||||
direction = PW_DIRECTION_OUTPUT;
|
||||
} else if (strstr(media_class, "Sink") != NULL) {
|
||||
|
|
@ -455,6 +451,10 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
if (monitor != NULL) {
|
||||
pw_properties_set(props, PW_KEY_MEDIA_CLASS, "Audio/Source");
|
||||
direction = PW_DIRECTION_OUTPUT;
|
||||
|
|
|
|||
|
|
@ -437,10 +437,6 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strstr(media_class, "Source") != NULL) {
|
||||
direction = PW_DIRECTION_OUTPUT;
|
||||
} else if (strstr(media_class, "Sink") != NULL) {
|
||||
|
|
@ -450,6 +446,10 @@ static struct endpoint *create_endpoint(struct node *node, struct endpoint *moni
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
if (monitor != NULL) {
|
||||
pw_properties_set(props, PW_KEY_MEDIA_CLASS, "Audio/Source");
|
||||
direction = PW_DIRECTION_OUTPUT;
|
||||
|
|
|
|||
|
|
@ -392,10 +392,6 @@ static struct endpoint *create_endpoint(struct node *node)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strstr(media_class, "Source") != NULL) {
|
||||
direction = PW_DIRECTION_OUTPUT;
|
||||
} else if (strstr(media_class, "Sink") != NULL) {
|
||||
|
|
@ -405,6 +401,10 @@ static struct endpoint *create_endpoint(struct node *node)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
props = pw_properties_new(NULL, NULL);
|
||||
if (props == NULL)
|
||||
return NULL;
|
||||
|
||||
pw_properties_set(props, PW_KEY_MEDIA_CLASS, media_class);
|
||||
|
||||
if ((str = pw_properties_get(pr, PW_KEY_PRIORITY_SESSION)) != NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue