<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kaigai</author_name>
  <author_url>https://blog.hatena.ne.jp/kaigai/</author_url>
  <blog_title>KaiGaiの俺メモ</blog_title>
  <blog_url>https://kaigai.hatenablog.com/</blog_url>
  <categories>
    <anon>OSS/Linux</anon>
  </categories>
  <description>PostgreSQLの中でlibselinux関数を使う場合、気をつけなければいけないのがリソースの確保/解放 PostgreSQLは独自にメモリ管理機構を持っていて、基本的にはpalloc()関数でメモリを取得する。これはMemoryContextと呼ばれるメモリ管理構造からメモリを割り当てるが、面白いことに、同一のMemoryContextから割り当てたメモリ領域は、後で一気に解放できる。そのため、リークの心配がない。 一方、libselinuxを使ってgetcon()とかした場合、内部的にmalloc()してメモリを確保するので、これらは確実にfree()しなければならない。まぁ、当然と…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkaigai.hatenablog.com%2Fentry%2F20061023%2F1161611901&quot; title=&quot;libselinuxを使うかどうか(1) - KaiGaiの俺メモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2006-10-23 22:58:21</published>
  <title>libselinuxを使うかどうか(1)</title>
  <type>rich</type>
  <url>https://kaigai.hatenablog.com/entry/20061023/1161611901</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
